add debug mode for gulp watch

This commit is contained in:
Florian BLOUET
2015-11-25 15:03:25 +01:00
parent f2daa53aa7
commit 3a785d6d44
12 changed files with 87 additions and 30 deletions

View File

@@ -1,6 +1,7 @@
var gulp = require('gulp');
var config = require('../config.js');
var utils = require('../utils.js');
var debugMode = false;
gulp.task('copy-authentication-images', function(){
return gulp.src([config.paths.src + 'authentication/images/**/*'])
@@ -9,7 +10,7 @@ gulp.task('copy-authentication-images', function(){
gulp.task('build-authentication-css', function(){
return utils.buildCssGroup([
config.paths.src + 'authentication/styles/main.scss'
], 'authentication', 'authentication/css/');
], 'authentication', 'authentication/css/', debugMode);
});
gulp.task('build-authentication-js', function(){
@@ -17,17 +18,20 @@ gulp.task('build-authentication-js', function(){
config.paths.vendors + 'requirejs/require.js',
config.paths.dist + 'scripts/apps/login/home/config.js'
];
return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js');
return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js', debugMode);
});
gulp.task('watch-authentication-js', function() {
debugMode = true;
return gulp.watch(config.paths.src + 'authentication/**/*.js', ['build-authentication-js']);
});
gulp.task('watch-authentication-css', function() {
debugMode = true;
gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']);
});
gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){
debugMode = false;
return gulp.start('build-authentication-js');
});