blob: 479273b1eb469c8dfcacdc5a5d27ba459a4af060 [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -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
Matteo Scandolo43ffb672016-12-02 14:49:58 -080013gulp.task('build', gulp.series('config', gulp.parallel('other', 'webpack:dist')));
14gulp.task('test', gulp.series('config', 'karma:single-run'));
Matteo Scandolod819c922016-12-02 14:06:14 -080015gulp.task('test:auto', gulp.series('karma:auto-run'));
Matteo Scandolo43ffb672016-12-02 14:49:58 -080016gulp.task('serve', gulp.series('config', 'webpack:watch', 'watch', 'browsersync'));
17gulp.task('serve:dist', gulp.series('config', 'default', 'browsersync:dist'));
Matteo Scandolod819c922016-12-02 14:06:14 -080018gulp.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}