Skip to content

Commit 7e7b963

Browse files
authored
feat: gulp task support to watch file changed (#251)
1 parent f8a89e2 commit 7e7b963

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

build/gulpfile.js

+28
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,31 @@ gulp.task(
9696
'build:i18n'
9797
)
9898
);
99+
100+
gulp.task(
101+
'watch',
102+
gulp.series(
103+
'clean',
104+
'build:esm',
105+
'build:sass',
106+
'build:extensions',
107+
'build:i18n',
108+
function watchFiles() {
109+
gulp.watch('../src/**/*.scss', gulp.series('build:sass'));
110+
gulp.watch(
111+
['../src/**/*.ts', '../src/**/*.tsx'],
112+
gulp.series('build:esm')
113+
);
114+
gulp.watch(
115+
[
116+
'../src/extension/**/*.svg',
117+
'../src/extension/**/*.json',
118+
'../src/extension/**/*.png',
119+
'../src/extension/**/*.md',
120+
],
121+
gulp.series('build:extensions')
122+
);
123+
gulp.watch('../src/i18n/**/*.json', gulp.series('build:i18n'));
124+
}
125+
)
126+
);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"build-umd": "rimraf umd && webpack --config ./build/webpack.umd.js",
1818
"check-types": "tsc",
1919
"build": "gulp --gulpfile ./build/gulpfile.js",
20+
"watch": "gulp --gulpfile ./build/gulpfile.js watch",
2021
"eslint": "eslint ./src/**/*.ts ./src/**/*.tsx",
2122
"stylelint": "stylelint **/*.{css,scss,sass}",
2223
"prettier": "prettier --ignore-unknown .",

0 commit comments

Comments
 (0)