fix(compiler): watch ts file (#4693)

This commit is contained in:
nemo-shen 2021-12-23 10:08:21 +08:00 committed by GitHub
parent 79820f7f45
commit 819efae7c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,10 @@ tasks.buildExample = gulp.series(
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)), .pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
() => { () => {
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath)); const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
appJson.pages.forEach((path) => { const excludePages = ['pages/dashboard/index'];
appJson.pages
.filter((page) => page.indexOf(excludePages) === -1)
.forEach((path) => {
const component = path.replace(/(pages\/|\/index)/g, ''); const component = path.replace(/(pages\/|\/index)/g, '');
const writeFiles = [ const writeFiles = [
{ {
@ -163,6 +166,7 @@ tasks.buildExample = gulp.series(
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir)); gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir));
gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml')); gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml'));
gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs')); gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs'));
gulp.watch(`${src}/**/*.ts`, tsCompiler(exampleDistDir, exampleConfig));
gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json')); gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json'));
} }
) )