replace gulp's built-in watch with gulp-watch

https://github.com/leonidas/gulp-project-template/issues/24
This commit is contained in:
Riku Rouvila
2015-08-12 22:02:20 +03:00
parent 907cf1a152
commit 54f261e1b7
2 changed files with 8 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ var streamify = require('gulp-streamify');
var stylus = require('gulp-stylus');
var uglify = require('gulp-uglify');
var watchify = require('watchify');
var watch = require('gulp-watch');
/*eslint "no-process-env":0 */
var production = process.env.NODE_ENV === 'production';
@@ -149,9 +150,12 @@ gulp.task('server', function() {
});
gulp.task('watch', function() {
gulp.watch(config.templates.watch, ['templates']);
gulp.watch(config.styles.watch, ['styles']);
gulp.watch(config.assets.watch, ['assets']);
['templates', 'styles', 'assets'].forEach(function(watched) {
watch(config[watched].watch, function() {
gulp.start(watched);
});
});
var bundle = watchify(browserify(browserifyConfig));

View File

@@ -34,6 +34,7 @@
"gulp-stylus": "~2.0.0",
"gulp-uglify": "~1.0.1",
"gulp-util": "~3.0.1",
"gulp-watch": "^4.3.4",
"jsdom": "^5.6.0",
"mocha": "^2.2.5",
"node-notifier": "^4.2.1",