javascript - Gulp task runs once, executes twice -
i'm using gulp compile stylus, task seems run twice making gulp-notify
trip.
here's gulpfile.js
var gulp, plugins; gulp = require('gulp'); plugins = require('gulp-load-plugins')(); /** * watch changes on stylus files, when detecting change run stylus task * @return {void} */ gulp.task('watch-stylus', function() { gulp.src('./app/resources/stylus/**/*.styl') .pipe(plugins.plumber()) .pipe(plugins.watch('./app/resources/stylus/**/*.styl', { verbose: true, readdelay: 0 })) .pipe(plugins.exec('gulp stylus')) .pipe(plugins.notify("stylus compiled")) .pipe(plugins.plumber.stop()); }); /** * compile stylus , auto prefix compiled css * @return {void} */ gulp.task('stylus', function() { gulp.src(['./app/resources/stylus/**/*.styl', '!./app/resources/stylus/**/_*.styl']) .pipe(plugins.plumber()) .pipe(plugins.stylus()) .pipe(plugins.autoprefixer({ browsers: ['last 2 versions'], cascade: false })) .pipe(plugins.plumber.stop()) .pipe(gulp.dest('web/css')); });
things i've checked
- no multiple dests.
- input , output dir different.
the plugins i'm using
gulp-load-plugins
load pluginsgulp-watch
watch file changesgulp-notify
notify stylus has been compiledgulp-stylus
compile stylusgulp-exec
run compile task when partial editedgulp-autoprefixer
prefix cssgulp-plumber
gulp-watch
doesn't die on error
Comments
Post a Comment