blob: 49fc013679372bf23f853257d7ad0915ce541d5a [file] [log] [blame]
Andrew Geissler7d6e6292018-05-24 12:06:58 -07001var options = require('../gulp-options.js'), gulp = require('gulp'),
Iftekharul Islam99d199f2017-03-24 15:28:25 -05002 connect = require('gulp-connect'),
3 distribution = require('./distribution.js');
4
5var runSequence = require('run-sequence');
6
Andrew Geissler7d6e6292018-05-24 12:06:58 -07007gulp.task('distribution', function(callback) {
8 return distribution(callback);
Iftekharul Islam99d199f2017-03-24 15:28:25 -05009});
10
11gulp.task('connect', function() {
Andrew Geissler7d6e6292018-05-24 12:06:58 -070012 connect.server({root: 'dist', livereload: true});
Iftekharul Islam99d199f2017-03-24 15:28:25 -050013});
14
15gulp.task('livereload', function() {
Andrew Geissler7d6e6292018-05-24 12:06:58 -070016 gulp.src(['./dist/**/*.html', './dist/**/*.js', './dist/**/*.css'])
17 .pipe(connect.reload());
Iftekharul Islam99d199f2017-03-24 15:28:25 -050018});
19
Andrew Geissler7d6e6292018-05-24 12:06:58 -070020gulp.task('watch', function() {
21 gulp.watch('./app/**/*', function(callback) {
Iftekharul Islam99d199f2017-03-24 15:28:25 -050022 return runSequence('distribution', 'livereload');
23 });
24});
25
Andrew Geissler7d6e6292018-05-24 12:06:58 -070026module.exports = function(callback) {
27 return runSequence('connect', 'watch', callback);
28};