-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
27 lines (22 loc) · 960 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { registry, parallel, series, task } = require('gulp');
const HubRegistry = require('gulp-hub');
const browserSync = require('browser-sync');
const argv = require('yargs').argv;
global.dev = !argv.dist;
global.browserSyncInstance = browserSync.create();
registry(new HubRegistry(['scripts/gulp/*.js']));
task('serve', callback => {
global.browserSyncInstance.init({
files: 'scripts/app/**/*.js',
server: true,
startPath: 'public'
});
callback();
});
task('clean', parallel('hbs-runtime:clean', 'requirejs:clean', 'sass:clean'));
task('watch', parallel('hbs-runtime:watch', 'hbs-static:watch', 'sass:watch'));
task('compile:dev', parallel('hbs-runtime:compile', 'hbs-static:compile', 'sass:compile'));
task('compile:dist', parallel(series('hbs-runtime:compile', 'requirejs:compile'), 'hbs-static:compile', 'sass:compile'));
exports.default = global.dev
? series('clean', 'compile:dev', 'serve', 'watch')
: series('clean', 'compile:dist');