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

How can I execute commands while Gulp.js is watching files?

I know that there are gulp plugins for executing commands within tasks. What I want to do is run Gulp and while it watching files, I can switch my git branch without having to open a new terminal tab, execute the command there, and then switch back.
Ian Walter
  • 882
  • 2
  • 8
  • 23
0
votes
3 answers

Gulp plumber cannot pipe to undefined

I am trying, to write a module that when gulp is watching a task, and a Less file changed with some error, it should give a message to the console, but it should not crash the system, which it does no: This is the code I have written: var onError =…
Manam
  • 354
  • 5
  • 16
0
votes
0 answers

Trying to share Gulp project with a friend

I have made a gulp project and I am trying to share it with a friend. Its a simple css grid with gulp tasks integrated. You can download the package here: https://www.dropbox.com/s/od1dsh75tegbq24/projectfolder.zip?dl=1 When you unzip the package…
Jabba Da Hoot
  • 794
  • 2
  • 7
  • 16
0
votes
0 answers

Gulpfile not watching scss

I have a simple gulpfile that loads a javascript object from a json file (to get paths based on environment), compiles my scss files, moves them to my public directory, and also moves any javascript files to the public directory. So my assets in…
Apollo
  • 945
  • 2
  • 9
  • 24
0
votes
1 answer

gulp watch copying files twice to different locations

Since yesterday something strange has started happening with my gulp-watch task. Afaik, all I did was change the destination but I can reproduce with the simple gulpfile posted below: I have a file structure like…
chriskelly
  • 7,526
  • 3
  • 32
  • 50
0
votes
2 answers

One gulp task file pr theme

Wondering what would be the best way to accomplish this. I have multiple themes in my web app, let's say: /themes/theme_one/ /themes/theme_two/ … etc. And I don't want to write one big gulp file that handles all of these. Instead I would like to be…
Torkil Johnsen
  • 2,375
  • 1
  • 18
  • 18
0
votes
1 answer

oo.load throwing "undefined is not a function"

I am building an app using requirejs, parse.com, list.js, and using gulp to serve it. I am trying to use ooCharts to load in google analytics charts. the failing code is written in a script tag in the html being injected on the DOM via a…
0
votes
1 answer

Gulp-js pass only saved file on to task

I want to pass a saved file which does not need to be compiled or does not need to be saved to a new location to gulp-tap so I can run an external script on it. Right now I watch a complete directory and on each save I upload the whole…
Harold
  • 365
  • 2
  • 9
0
votes
2 answers

How do I make my gulpfile restart when a file is edited?

right now I have to stop and start this gulp script to clean and rebuild my dist file and then restart the server. My watch file is clearly wrong, what do I change for it to restart the whole gulp script when a file is edited? var gulp =…
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84
0
votes
1 answer

GulpJS - live reload with Laravel

I'm trying to get this working and I have spent a day now with not much success... I'm new to both Laravel and GulpJS, which makes it even better I guess... :) What I'm trying to achieve is a (preferably cross-platform) solution for reloading the…
Barnabas Kecskes
  • 1,861
  • 17
  • 24
0
votes
2 answers

How do I pass to other gulp tasks from gulp watch

I'm pretty new to gulp, here's what's happening I did have: gulp.watch(config.build.sass + '/**/*.scss', ['sass-dev']); But this didn't catch any new files, so after reading the docs I need to have: gulp.watch({ glob: config.build.sass +…
designermonkey
  • 1,078
  • 2
  • 16
  • 28
0
votes
1 answer

Automatically restart GulpJS watch when gulp file changes

Lets say I have gulp watch running and I add a file to a task. Is there any way to have the gulp watch process automatically restart since a task has changes?
ryanzec
  • 27,284
  • 38
  • 112
  • 169
0
votes
2 answers

gulp-watch breaks when new files are added

I'm using gulp-watch plugin and would like to copy newly added files in the source to the target destination. watch({glob:SOURCE + '/**/*.js'}) .pipe(plumber()) .pipe(gulp.dest(DESTINATION)); Every time a new file is added into the SOURCE…
Denzo
  • 431
  • 1
  • 4
  • 15
0
votes
2 answers

In gulp, how do watch a set of filtered files, then call a task?

I'm trying to use Gulp to watch for my source changes then compile, lint and reload my app. From my understanding gulp.watch does not allow filtering of resources, so everything is reloaded if I updated a spec/test file. For example: jsSrc =…
bryce
  • 763
  • 6
  • 13
-1
votes
1 answer

AssertionError when updating to Gulp 4.0

Got fed up that i couldn't use some newer CSS Grid properties in my project and decided to upgrade my build environment. Got to the point that i have updated node, npm, gulp, and all my packages. But i get errors trying to run gulp in my…
nicklas bryntesson
  • 149
  • 1
  • 3
  • 12
1 2 3
55
56