Questions tagged [gulp-watch]

A gulp plugin that listens for file changes and emits changed files into the stream. Not to be confused with the built-in gulp.watch().

Installation

npm install --save-dev gulp-watch

Usage

gulp.task('watch-css', function () {
  return gulp.src('css/**/*.css')
    .pipe(watch('css/**/*.css'))
    .pipe(gulp.dest('build'));
});

Recipes

Links

836 questions
9
votes
2 answers

Watch task not continuing after error caught by Gulp-plumber has been fixed despite errorHandler callback

So I got this neat gulpfile and all, and it's working smoothly except for this one thing. I'm running gulp-plumber to stop the watch task from crashing on an error, the error is getting caught by it but then when I fix the error, the watcher refuse…
Chrillewoodz
  • 27,055
  • 21
  • 92
  • 175
8
votes
1 answer

cannot create a property 'mark' on string

I am new to Gulp. I have two tasks: gulp.task('jadehtml', function() { var YOUR_LOCALS = {}; gulp.src('source/jade/*.jade') .pipe(jade({ locals: YOUR_LOCALS, pretty: true })) .pipe(gulp.dest('build')) }); // End Gulp Jade…
Cloudboy22
  • 1,496
  • 5
  • 21
  • 39
8
votes
2 answers

Gulp Error: watch ENOSPC

Hi i'm getting this error while running gulp watch. im using vueify in laravel project. why is this happening. it was working fine all these days and this came in today. $ gulp watch [12:56:01] Using gulpfile…
bazi
  • 1,758
  • 5
  • 27
  • 41
8
votes
1 answer

Gulp watch delete files

I'm new to Gulp, i did some research but not found solutions .. Here is my Gulpfile. var gulp = require('gulp'); var watch = require('gulp-watch'); var imagemin = require('gulp-imagemin'); var browserSync = require('browser-sync').create(); var…
user6004593
8
votes
2 answers

Changing Laravel's Gulp/Elixir `watch` task

I want to use Laravel's Elixir along with Semantic UI in my new project. In Semantic UI docs, they suggest how to include their gulp tasks to your current project's gulpfile. In Laravel, they suggest (briefly) how to extend Elixir. But how can I…
igorsantos07
  • 4,456
  • 5
  • 43
  • 62
8
votes
2 answers

Browserify errors ending gulp watch task

I've got the following setup in my gulpfile.js: gulp.task('browserify', function() { browserify(config.paths.browserifyEntry) .transform(reactify) .bundle() .pipe(source('master.js')) …
jdavis
  • 8,255
  • 14
  • 54
  • 62
8
votes
5 answers

Gulp with watchify/browserify runs twice then stops watching

Here is my gulpfile.js var gulp = require('gulp'); var browserify = require('browserify'); var source = require("vinyl-source-stream"); var reactify = require("reactify"); var watchify = require('watchify'); var gutil = require('gulp-util'); var…
thealexbaron
  • 1,558
  • 1
  • 11
  • 25
8
votes
1 answer

Browser-sync (under gulp) doesn't refresh browser

My config does everything it's supposed to, but it never refreshes the browser. Once I refresh it manually, changes are there. I am connecting to the default localhost:3000. Any ideas why is it so or how to debug it? gulpfile.js: var gulp =…
rdkn
  • 566
  • 7
  • 14
8
votes
3 answers

Gulp task pipeline to only concat if source file(s) changed

I have a gulp task that generates concatenated JS files. I am using a watch to detect changes to all the files in the project and would like the concat task to only re-concatenate the files if the source files have changed since last execution. …
Allen
  • 3,134
  • 5
  • 29
  • 49
8
votes
1 answer

Gulp src returns empty file

I'm trying to create Gulp task for sass/js compilation and I've also included code for live reload. It works fine except that sometimes gulp.src throws empty files into the pipe when I edit them. var gulp = require('gulp'); var sass =…
user3360496
  • 357
  • 2
  • 7
7
votes
2 answers

Gulpfile.js watch best practice

here is my current watchlist for my gulpfile.js // Gulp watchlist gulp.task('watch', ['browserSync', 'sass'], function(){ gulp.watch('app/scss/**/*.scss', ['sass']); gulp.watch('app/*.html').on('change', browserSync.reload); …
Brock Vond
  • 216
  • 2
  • 7
7
votes
0 answers

Gulp Segmentation Fault 11, Abort Trap 6

When one of the gulp.watch tasks is fired (css:dist, mostly), I get one of the following errors: Abort Trap 6 or Segmentation fault: 11. Also, it's only happened once, but I got another error message displayed after Gulp halted: Trace/BPT trap: 5.…
wdews
  • 352
  • 2
  • 17
7
votes
3 answers

How to use gulp-watch?

What is the proper way to use gulp-watch plugin? ... var watch = require('gulp-watch'); function styles() { return gulp.src('app/styles/*.less') .pipe(watch('app/styles/*.less')) .pipe(concat('main.css')) .pipe(less()) …
alex.mironov
  • 2,834
  • 6
  • 27
  • 41
7
votes
2 answers

How to combine gulp-watch and gulp-inject?

I am trying to use both gulp-watch and gulp-inject to build my Node Web app. However, it seems that the build step involving gulp-inject won't work once gulp-watch gets involved. Seemingly, the reason is that the watch stream never ends and…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
7
votes
1 answer

Gulp Watch Concat sometimes ignores some JS files

I have a Gulp concat watch task setup to concat some JS files: var sources = [ 'public/js/scriptA.js', 'public/js/scriptB.js', 'public/js/scriptC.js', 'public/js/scriptD.js', 'public/js/scriptE.js' ]; gulp.task('main.js', function(){ …
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
1 2
3
55 56