Skip to content

Commit ae1a5ec

Browse files
committed
run sequense in watch tasks
1 parent f6996b1 commit ae1a5ec

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

scripts/gulpfile.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const gulp = require('gulp');
33
const connect = require('gulp-connect');
44
const gopen = require('gulp-open');
5+
const runSequence = require('run-sequence');
56

67
const buildKsCore = require('./build-ks-core.js');
78
const buildKsVue = require('./build-ks-vue.js');
@@ -33,27 +34,27 @@ gulp.task('build-vue', buildVue);
3334
// Watchers
3435
const watch = {
3536
all() {
36-
gulp.watch(['./src/core/**/*.js'], ['core-js', 'ks-react', 'ks-vue']);
37-
gulp.watch('./src/core/**/*.less', ['core-less']);
38-
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], ['phenome', 'build-react', 'build-vue', 'ks-react', 'ks-vue']);
39-
gulp.watch(['./react/kitchen-sink/src/**/*.js', './react/kitchen-sink/src/**/*.jsx'], ['ks-react']);
40-
gulp.watch(['./vue/kitchen-sink/src/**/*.js', './vue/kitchen-sink/src/**/*.jsx'], ['ks-vue']);
37+
gulp.watch(['./src/core/**/*.js'], () => runSequence('core-js', 'core-components', 'ks-react', 'ks-vue'));
38+
gulp.watch('./src/core/**/*.less', () => runSequence('core-less', 'core-components'));
39+
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], () => runSequence('phenome', 'build-react', 'build-vue', 'ks-react', 'ks-vue'));
40+
gulp.watch(['./react/kitchen-sink/src/**/*.js', './react/kitchen-sink/src/**/*.jsx'], () => runSequence('ks-react'));
41+
gulp.watch(['./vue/kitchen-sink/src/**/*.js', './vue/kitchen-sink/src/**/*.jsx'], () => runSequence('ks-vue'));
4142
},
4243
core() {
43-
gulp.watch(['./src/core/**/*.js'], ['core-js']);
44-
gulp.watch('./src/**/**/*.less', ['core-less']);
44+
gulp.watch(['./src/core/**/*.js'], () => runSequence('core-js', 'core-components'));
45+
gulp.watch('./src/**/**/*.less', () => runSequence('core-less', 'core-components'));
4546
},
4647
react() {
47-
gulp.watch(['./src/core/**/*.js'], ['core-js', 'ks-react']);
48-
gulp.watch('./src/core/**/*.less', ['core-less']);
49-
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], ['phenome', 'build-react', 'ks-react']);
50-
gulp.watch(['./react/kitchen-sink/src/**/*.js', './react/kitchen-sink/src/**/*.jsx'], ['ks-react']);
48+
gulp.watch(['./src/core/**/*.js'], () => runSequence('core-js', 'core-components', 'ks-react'));
49+
gulp.watch('./src/core/**/*.less', () => runSequence('core-less', 'core-components'));
50+
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], () => runSequence('phenome', 'build-react', 'ks-react'));
51+
gulp.watch(['./react/kitchen-sink/src/**/*.js', './react/kitchen-sink/src/**/*.jsx'], () => runSequence('ks-react'));
5152
},
5253
vue() {
53-
gulp.watch(['./src/core/**/*.js'], ['core-js', 'ks-vue']);
54-
gulp.watch('./src/core/**/*.less', ['core-less']);
55-
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], ['phenome', 'build-vue', 'ks-vue']);
56-
gulp.watch(['./vue/kitchen-sink/src/**/*.js', './vue/kitchen-sink/src/**/*.jsx'], ['ks-vue']);
54+
gulp.watch(['./src/core/**/*.js'], () => runSequence('core-js', 'core-components', 'ks-vue'));
55+
gulp.watch('./src/core/**/*.less', () => runSequence('core-less', 'core-components'));
56+
gulp.watch(['./src/phenome/**/*.js', './src/phenome/**/*.jsx'], () => runSequence('phenome', 'build-vue', 'ks-vue'));
57+
gulp.watch(['./vue/kitchen-sink/src/**/*.js', './vue/kitchen-sink/src/**/*.jsx'], () => runSequence('ks-vue'));
5758
},
5859
};
5960

0 commit comments

Comments
 (0)