Make grunt watch (for scripts) work again, settings were being overwritten by the new watch-style command

This commit is contained in:
Dannon Baker
2016-05-03 10:09:31 -04:00
parent 13c7143119
commit 85a0a0b7bb
2 changed files with 14 additions and 10 deletions
-1
View File
@@ -56,7 +56,6 @@ module.exports = function( grunt ){
if (grunt.option( 'develop' )){
grunt.config( 'uglify.options', decompressedSettings );
} else {
grunt.config( 'uglify.target.options', {
sourceMap : true,
+14 -9
View File
@@ -78,16 +78,21 @@ module.exports = function( grunt ){
// -------------------------------------------------------------------------- watch & rebuild less files
// use 'grunt watch-style' (from a new tab in your terminal) to have grunt re-copy changed files automatically
grunt.config( 'watch', {
watch: {
// watch for changes in the src dir
files: [ lessPath + '/**' ],
tasks: ['check-modules', 'sprite', 'less-site-config', 'less', 'clean'],
options: {
spawn: false
//
// the conditional prevents reconfiguration of 'normal' (.js) grunt watch from grunt-tasks/scripts.js
if (this.cli.tasks.indexOf("watch-style") > -1){
grunt.config( 'watch', {
watch: {
// watch for changes in the src dir
files: [ lessPath + '/**' ],
tasks: ['check-modules', 'sprite', 'less-site-config', 'less', 'clean'],
options: {
spawn: false
}
}
}
});
});
}
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.loadNpmTasks( 'grunt-spritesmith' );