Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 1 | var options = require('../gulp-options.js'), |
| 2 | gulp = require('gulp'), |
| 3 | connect = require('gulp-connect'), |
| 4 | distribution = require('./distribution.js'); |
| 5 | |
| 6 | var runSequence = require('run-sequence'); |
| 7 | |
| 8 | gulp.task('distribution', function (callback) { |
| 9 | return distribution(callback); |
| 10 | }); |
| 11 | |
| 12 | gulp.task('connect', function() { |
| 13 | connect.server({ |
| 14 | root: 'dist', |
| 15 | livereload: true |
| 16 | }); |
| 17 | }); |
| 18 | |
| 19 | gulp.task('livereload', function() { |
| 20 | gulp.src(['./dist/**/*.html','./dist/**/*.js','./dist/**/*.css']) |
| 21 | .pipe(connect.reload()); |
| 22 | }); |
| 23 | |
| 24 | gulp.task('watch', function () { |
| 25 | gulp.watch('./app/**/*', function(callback){ |
| 26 | return runSequence('distribution', 'livereload'); |
| 27 | }); |
| 28 | }); |
| 29 | |
| 30 | module.exports = function (callback) { |
| 31 | return runSequence('connect', 'watch', callback); |
| 32 | }; |