Skip to content

Commit bad1e2c

Browse files
committed
chore(ts): the example folder was renamed to examples
1 parent 35aca76 commit bad1e2c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

templates/typescript/scripts/serve.cjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@ const WORKING_DIRECTORY = path.resolve(__dirname, '..');
1010

1111
// ! 脚本必须在项目根目录执行,防止脚本执行错误
1212
if (!fse.pathExistsSync(path.join(WORKING_DIRECTORY, 'package.json'))) {
13-
throw new Error('The package.json file does not exist in the current working directory.\n');
13+
throw new Error(
14+
'The package.json file does not exist in the current working directory.\n',
15+
);
1416
}
1517

16-
const PUBLIC_DIR = 'example/';
18+
const PUBLIC_DIR = 'examples/';
1719

1820
browserSync.watch(
1921
[`${PUBLIC_DIR}**/*`],
2022
{
21-
ignoreInitial: true
23+
ignoreInitial: true,
2224
},
2325
async (event, file) => {
2426
if (!['add', 'change'].includes(event)) return;
2527

2628
browserSync.reload();
27-
}
29+
},
2830
);
2931

3032
browserSync.init({
@@ -34,7 +36,7 @@ browserSync.init({
3436
startPath: PUBLIC_DIR,
3537
// reloadThrottle: 1e3,
3638
open: true,
37-
notify: false
39+
notify: false,
3840
});
3941

4042
exports.browserSync = browserSync;

0 commit comments

Comments
 (0)