blob: 45cac240f6b3a01a7670c68ef5fd3920871ee865 [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 Scandolo828d1e82017-01-17 14:49:38 -080013gulp.task('build', gulp.series(gulp.parallel('other', 'webpack:dist')));
Matteo Scandolo70377e52017-04-10 16:41:28 -070014gulp.task('test', gulp.series('karma:single-run', 'remap-istanbul'));
Matteo Scandolod819c922016-12-02 14:06:14 -080015gulp.task('test:auto', gulp.series('karma:auto-run'));
Matteo Scandolo828d1e82017-01-17 14:49:38 -080016gulp.task('serve', gulp.series('webpack:watch', 'watch', 'browsersync'));
17gulp.task('serve:dist', gulp.series('default', 'browsersync:dist'));
Matteo Scandolo4e870232017-01-30 13:43:05 -080018gulp.task('serve:dist:watch', gulp.series('clean', 'other', 'webpack:dist:watch', 'browsersync:dist'));
Matteo Scandolod819c922016-12-02 14:06:14 -080019gulp.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}