blob: 04d30c0c4c05310dd09500992e5b01be318cc75a [file] [log] [blame]
Max Chu3c8b65f2017-07-19 17:47:59 -07001const gulp = require('gulp');
2const HubRegistry = require('gulp-hub');
3const browserSync = require('browser-sync');
4
5const conf = require('./conf/gulp.conf');
6// const ngConstant = require('gulp-ng-constant');
7
8// Load some files into the registry
9const hub = new HubRegistry([conf.path.tasks('*.js')]);
10
11// Tell gulp to use the tasks just loaded
12gulp.registry(hub);
13
14gulp.task('build', gulp.series(gulp.parallel('other', 'webpack:dist')));
15gulp.task('test', gulp.series('karma:single-run'));
16gulp.task('test:auto', gulp.series('karma:auto-run'));
17gulp.task('serve', gulp.series('webpack:watch', 'watch', 'browsersync'));
18gulp.task('serve:dist', gulp.series('default', 'browsersync:dist'));
19gulp.task('default', gulp.series('clean', 'build'));
20gulp.task('watch', watch);
21
22function reloadBrowserSync(cb) {
23 browserSync.reload();
24 cb();
25}
26
27function watch(done) {
28 gulp.watch(conf.path.tmp('index.html'), reloadBrowserSync);
29 done();
30}