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.

image: one file change

the plugins i'm using

  • gulp-load-plugins load plugins
  • gulp-watch watch file changes
  • gulp-notify notify stylus has been compiled
  • gulp-stylus compile stylus
  • gulp-exec run compile task when partial edited
  • gulp-autoprefixer prefix css
  • gulp-plumber gulp-watch doesn't die on error


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -