compass sass - gulp.js: 'gulp.watch' is not really watching changes -


I'm having trouble using gulp.watch to check changes in my .scss and images files. Only then is working when I create or edit the javascript file, so 'clock' is working, but this is my code only for javascript files:

  var gulp = require ('gulp'), concat = need ('gulp-concat'), uglify = require ('gulp-uglify'), rename = require ('Gulp-rename'), compass = ('gulp-compass '), minify CSS = 'Required' ('Gullup-Minivity-CSS'), ImageMenu = ('Gulp-Imageman'), notify = notify '), Clear = requires (' Gullp-Clean ') Requires filesize = ('files-files'); Gulp.task ('scripts', function () {return gulp.src (' src / js / *. Js') .pipe (concat ('main.js')) .Pipe (gulp.dest (' build / dev / Js')) .pipe (files ()) .pipe (euglif ()) .pipe (gulp.dest ('build / production / js')) .pipe (file ()) .Pipe (notify ({message : 'Javascript function complete'}));}); Gulp.task ('compass', function () {return gulp.src ([' src / sass / ** / *. Scss']) .Pipe (compass ({css: 'src / css', sass:' src / Sass ', image:' src / images '}) .pipe (gulp.dest (' build / dev / css ')) .pipe (minify css) .pip (gulp.dest (' build / production / css')) .pipe (notify ({message: 'compass function complete'}))}); Gulp.task ('images', function () 'return gulp.src' ('src / images / ** / *'). Pipe (imageman ({optimization level: 5, progressive: true, interlaced: true})). Pipes (Gulp.dest ('build / dev / img')) .pipe (gulp.dest ('build / production / img')) .pip (notify ({message: 'image work complete'})}) ; Gulp.task ('watch', function () {gulp.watch ('src / js / * .js', ['scripts']); gulp.watch ('src / sass / ** / * .css' , ['Compass']); go.watch ('src / images / ** / *', ['picture'])}}; Gulp.task ('clean', function () {return gulp.src ( ['build / *'], {read: false}) .pipe (clean);}); Gulp.task ('default', ['clean'], function () {gulp.start ('script' , 'Compass',' f ('Clock');});   

"> < P> Some pointers about your code sample:

  • There is really no need to use the gulp-clean plug-in in your case (this is more Is suitable for other scenarios). Instead use rimraf .
  • Try to avoid using gulp.start (...), because it is not considered to be used by end users and its support will most likely be dropped in future releases. You can try to use it. For example, if your 'script', 'images' and 'compass' tasks are all dependent on 'clean', and your 'default' class depends on 'script', 'image' and 'compass' Clean 'work can only be executed once.

    You might want to see the gulpfile.js sample in this project:



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -