It is a plugin for gruntjs. It runs predefined tasks whenever watched file patterns are added, changed or deleted.
Questions tagged [grunt-contrib-watch]
435 questions
10
votes
1 answer
Grunt: Fatal error: watch EPERM
You can view/clone the full code here: https://github.com/mlewisTW/grunt-tests
I'd like to watch the src directory (to minify, concat, less, etc), which puts everything into the build dir. I'd also like to watch the build dir in order to…

Michael Lewis
- 4,252
- 6
- 28
- 39
10
votes
2 answers
Why isn't grunt-contrib-watch livereload working?
I'm struggling to get Grunt's "live reload" ability (as implemented in grunt-contrib-watch) to work in my app. I finally bit the bullet, and tried making a minimal example. Hopefully someone can easily notice what's missing.
File Structure:
├──…

Zach Lysobey
- 14,959
- 20
- 95
- 149
10
votes
4 answers
How can I use grunt-contrib-watch and grunt-contrib-coffee to compile CoffeeScript only as needed?
I'd like to run coffee lint and coffee compile on only the single file that I'm saving. There are hundreds of CoffeeScript files in my project, and compiling all of them takes too much time.
Here's my Gruntfile:
module.exports = (grunt) ->
…

Eric the Red
- 5,364
- 11
- 49
- 63
10
votes
2 answers
LiveReload ASP.net MVC web app with Grunt
Is it possible in grunt to watch files and automatically reload a ASP.net MVC web application. Or does livereload only work with files served through grunt. I have come across grunt plugin 'grunt-iisexpress' but not really sure if I can use it, in…

nimgrg
- 582
- 1
- 7
- 17
10
votes
5 answers
grunt watch livereload Fatal error: Port 35279 is already in use by another process
I'm trying to use livereload with watch. I keep getting the message "Fatal error: Port 35279 is already in use by another process" . I've changed the port for livereload but then nothing reloads.
module.exports = function(grunt)…

user2808895
- 438
- 1
- 6
- 14
9
votes
4 answers
Grunt with Compass and Watch compiles slow
Grunt takes a quite long to compile the css file, I am not sure if this is normal but regular compass watch takes around 5 seconds.
So the question is if there is any way to speed up the compilation time with Grunt or is it better to just stick…

xphong
- 1,114
- 2
- 13
- 20
9
votes
5 answers
Grunt watch: only upload files that have changed
related
I was able to set up a Grunt task to SFTP files up to my dev server using grunt-ssh:
sftp: {
dev: {
files: {
'./': ['**','!{node_modules,artifacts,sql,logs}/**'],
},
options: {
path:…

mpen
- 272,448
- 266
- 850
- 1,236
9
votes
2 answers
Grunt watch tasks seem to take a very long time
I'm running two simple tasks that run for <100ms each but when run under the watch command the two combined tasks are taking ~8 seconds in total (there seems to be an overhead of 3.5 seconds per task). I'm using it with live-reload for development…

DaveJ
- 2,357
- 6
- 28
- 35
9
votes
2 answers
Grunt watch not working
I tried to run the watch task by grunt in node.js but it doesn't work for me (this is what I got):
$ grunt watch
warning: Maximum call stack size exceeded Use --force to continue.
This is the part of the watch task in the Gruntfile.js:
watch: {
…

elkebirmed
- 2,247
- 6
- 24
- 35
8
votes
2 answers
How to conditionally compile (using Grunt) only changed jade files with template includes
Using a version of what grunt-contrib-watch recommends for compiling only changed files in here: https://github.com/gruntjs/grunt-contrib-watch#compiling-files-as-needed
var changedFiles = Object.create(null);
var onChange =…

Gilad Peleg
- 2,010
- 16
- 29
8
votes
2 answers
Grunt watch: compile only one file not all
I have grunt setup to compile all of my coffee files into javascript and maintain all folder structures using dynamic_mappings which works great.
coffee: {
dynamic_mappings: {
files: [{
expand: true,
cwd: 'assets/scripts/src/',
…

James Billings
- 448
- 7
- 16
7
votes
2 answers
Grunt Watch Event with Grunt Copy for Only Changed Files
Okay I've been stuck on this for 2 weeks, so hopefully someone else here has run across this problem. I'm trying to use Grunt to copy only files that have changed. I've seen numerous examples of how to do this with JSLINT and UGLIFY but no…

jjsquared
- 299
- 3
- 9
7
votes
1 answer
ctrl-c [SIGINT] not working with Grunt while using grunt-shell
If I use Grunt Task Runner with grunt-shell, I'm not able to exit the grunt using ctrl-c [SIGINT].
grunt.registerTask('serve', [
'less',
'autoprefixer',
'shell:hologram', // grunt-shell task
'connect:livereload',
'watch'
]);
Here is how…

Saneef
- 8,620
- 7
- 29
- 42
7
votes
2 answers
grunt-notify: Doesn't trigger on success
I am attempting to setup grunt-notify with grunt-contrib-less and grunt-contrib-watch. Generally this is working well but I can't get grunt-notify to notify me when grunt-less is executed successfully.
If anyone has any insight on how to set this…

sixtyfootersdude
- 25,859
- 43
- 145
- 213
7
votes
1 answer
Run all Grunt SubTasks except one
I've a bunch of subtasks for grunt watch (e.g. grunt watch:styles, grunt watch:sprites, etc). Then many other tasks run grunt watch. I would like to exclude one task. Is there a way to specify that? Basically run all grunt watch subtasks except…

Miguel Madero
- 1,948
- 13
- 21