Skip to content

Commit

Permalink
feat: gulp task support to watch file changed (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortalYoung authored Jul 19, 2021
1 parent f8a89e2 commit 7e7b963
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions build/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,31 @@ gulp.task(
'build:i18n'
)
);

gulp.task(
'watch',
gulp.series(
'clean',
'build:esm',
'build:sass',
'build:extensions',
'build:i18n',
function watchFiles() {
gulp.watch('../src/**/*.scss', gulp.series('build:sass'));
gulp.watch(
['../src/**/*.ts', '../src/**/*.tsx'],
gulp.series('build:esm')
);
gulp.watch(
[
'../src/extension/**/*.svg',
'../src/extension/**/*.json',
'../src/extension/**/*.png',
'../src/extension/**/*.md',
],
gulp.series('build:extensions')
);
gulp.watch('../src/i18n/**/*.json', gulp.series('build:i18n'));
}
)
);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"build-umd": "rimraf umd && webpack --config ./build/webpack.umd.js",
"check-types": "tsc",
"build": "gulp --gulpfile ./build/gulpfile.js",
"watch": "gulp --gulpfile ./build/gulpfile.js watch",
"eslint": "eslint ./src/**/*.ts ./src/**/*.tsx",
"stylelint": "stylelint **/*.{css,scss,sass}",
"prettier": "prettier --ignore-unknown .",
Expand Down

0 comments on commit 7e7b963

Please sign in to comment.