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
4
votes
1 answer

How to pass an argument from a gulp watcher to a task

If I have a watcher like this: gulp.watch('js/**/*.js').on('change', path => { gulp.series(build, reload)(); }); ...and task build would look like this: const build = done => { return gulp .src(path) // Use "path" here .pipe( …
user10392874
4
votes
0 answers

gulp-sass is very slow in gulp 4

After updating the gulp version to gulp 4, gulp-sass is taking much time to watch and compile scss. It was fast with gulp version 3.9.1. Gulp-sass version is 2.3.2. Is there any solution? Note: Removing the sourcemaps didn't help.
Fathima Linsa K
  • 618
  • 6
  • 14
4
votes
0 answers

Add React Component to Laravel

I'm new to Laravel and react and I just wanted to use react component along side with Laravel. I followed the process described here but when I run gulp watch I get this error:…
Kibo
  • 870
  • 1
  • 15
  • 30
4
votes
1 answer

Gulp 4 - Error: write after end

I'm getting an error when I watch for changes in index.html (full path in CONFIG.APP.INDEX). All my tasks are in separate files. this is tasks/watch.ts, for example: import * as CONFIG from '../config'; export default done => { // other watches …
Sasxa
  • 40,334
  • 16
  • 88
  • 102
4
votes
0 answers

gulp browsersync sass partials

I have the following problem and don't know whats going wrong with my gulpfile. Everything is working fine and my sass files are being compiled and the browser refreshed when changing something. But if I add a new partial file and import it into my…
4
votes
0 answers

Gulp+Typescript+Browsersync Slow to compile

I have defined a gulp task to watch .ts files and compile the typescript on file changes. BrowserSync then detects js file changes and reloads the page. When I change some .ts file and save, the whole compilation + file change detection process…
jeanpaul62
  • 9,451
  • 13
  • 54
  • 94
4
votes
1 answer

Gulp watch not working with imported files but works with main file

So I have my build script below and everything is working perfectly except that if I save a file that is not my app.scss file but something that is imported into that file, the sass task does not run. So my gulp build is watching but not all the…
4
votes
2 answers

visual studio (2015) Task Runner "Project Open" bound task is launched twice when open solution

I have a "watch" task that bound it to "project open" binding . but when open the solution , it is run twice ... my solution includes these projects: Controllers EFRepository Infrastructure Model ReportLibrary WebUI Design and my watch task…
sha
  • 147
  • 2
  • 16
4
votes
1 answer

Gulp copies file but it is empty

I'm having a strange problem. I'm using gulp to compile a react app and am having it copy index.html to the appropriate web directory. When I first run gulp, all runs as expected, but when the file changes and the watch task is run, gulp copies an…
user2027202827
  • 1,234
  • 11
  • 29
4
votes
1 answer

Gulp-watch typescript files and publish only changed files

In Visual Studio 2015, I am tracking the changes done on my TS files so that I can copy the generated JS files and output them to my wwwroot directory. However, whenever I do a change on a single TS file, all of them are built and outputted to the…
raberana
  • 11,739
  • 18
  • 69
  • 95
4
votes
0 answers

Gulp watch task runs once, then hangs on the 2nd run

I have some gulp tasks to run my TSLint checks for a project. I have a task to only watch the newly changed files and run the checks for these when they change (upon file save). Currently when I run the watchTS task, it will run and work fine upon…
Chris Barr
  • 29,851
  • 23
  • 95
  • 135
4
votes
3 answers

Gulp play sound on error

Anyone know how to have a sound ( like grunt ) when gulp throw a error during compile/watch ? l need to setup something special for gulp for have this feature ?
Lofka
  • 179
  • 1
  • 2
  • 9
4
votes
3 answers

jasmine with gulp, run tests on test file changed

Hi what I trying to do is to make watcher task with gulp which will run my jasmine tests. What I have done so far: var watch = require("gulp-watch"); var jasmine = require("gulp-jasmine"); gulp.task('tests.run.change-watcher', function (cb) { …
Maris
  • 4,608
  • 6
  • 39
  • 68
4
votes
1 answer

Gulp not watching files with gulp-watch plugin

I'm trying to rebuild only files that change in my gulpfile.js by using this recipe via the gulp-watch plugin. The problem is when I run my default task gulp, it doesn't watch the files at all after saving any of the files I want it to watch. What…
jtarr523
  • 261
  • 1
  • 5
  • 16
4
votes
0 answers

gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85

I'm running nodejs 0.12.3 - gulp 3.10.8 and Gulp-nodemon 2.0.3. gulpfile.js : gulp.task('serve', ['build'], function() { gulp.start('fb-flo'); nodemon({ script: paths.server, env: { 'NODE_ENV': 'development' }, // env: {…
user2702566
  • 115
  • 15