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