Questions tagged [grunt-contrib-watch]

It is a plugin for gruntjs. It runs predefined tasks whenever watched file patterns are added, changed or deleted.

435 questions
7
votes
2 answers

Grunt: Watch multiple files, compile only changed - livereload breaks?

I am new to Grunt and to Javascript/Coffeescript altogether. We are using Grunt in a rather large project with hundreds of .coffee - files. Since Grunt compiles all coffeefiles (although only one file has changed), my initial question was on how to…
6
votes
1 answer

Grunt-contrib-watch doesn't see new files

I made Gruntfile.js like this: 'use strict'; module.exports = function (grunt)…
6
votes
1 answer

Codeigniter and React.JS setup

Im planning to have Codeigniter and ReactJS for my new project, I need to know how to setup the project folders and the build process for the .jsx files to be .js and then all the .js files to be concatenated and minified to be min.js I'm thinking…
Sahan
  • 1,422
  • 2
  • 18
  • 33
6
votes
2 answers

Grunt Watch repeatedly showing "Warning: must provide pattern"

I'm having trouble configuring Grunt to watch my project files, rebuild and update a page hosted in a connect server. If I run any of the build tasks and then 'watch' as part of a combined task, then 'watch' seems to get stuck in a loop, endlessly…
Simon Dell
  • 638
  • 1
  • 7
  • 17
6
votes
2 answers

Grunt doesn't update main scss file

I have a project that uses GruntJS with grunt-contrib-sass, grunt-contrib-watch and grunt-newer. My main app.scss file imports a few .scss files with the @import directive like @import "common/vars.scss"; If I make changes in the main app.scss…
isHristov
  • 1,546
  • 2
  • 16
  • 18
6
votes
1 answer

Grunt config watch and karma:unit in single task

Currently I have following Gruntfile configuration with two separate tasks and it works perfect: grunt.registerTask('server', [ 'connect', 'jshint', 'less:dev', 'watch' ]); grunt.registerTask('test', [ 'karma:unit' ]); I'd like…
Artem Petrosian
  • 2,964
  • 1
  • 22
  • 30
6
votes
1 answer

grunt-autoprefixer loops endlessly when using grunt-contrib-watch

I'm just learning Grunt. I'm going to use compass for vertical rhythm and image sprite generation and autoprefixer for prefixing css3 styles. Here's my Gruntfile.js. module.exports = function(grunt) { var globalConfig = { sassDir: 'sass', …
chanHXC
  • 611
  • 1
  • 7
  • 17
6
votes
1 answer

Gruntjs: Fatal error: getaddrinfo ENOTFOUND

i should probably point out that i'm inexperienced user first, and my issue is that the 'hostname' property can't have any values assigned except for an empty string(''), '0.0.0.0' and 'localhost'. I getting: Fatal error: getaddrinfo ENOTFOUND. What…
orustammanapov
  • 1,792
  • 5
  • 25
  • 44
5
votes
3 answers

How to fix requires a peer of grunt@~0.4.0 while installing grunt plugins?

I am trying to install some Grunt plugins like grunt-contrib-clean and grunt-contrib-watch using npm install grunt-contrib-clean --save-dev and npm install grunt-contrib-watch --save-dev I got these warnings: npm WARN stellarhse@1.0.0 requires a…
5
votes
1 answer

open automaticaly browser and reload it when files changed with grunt

I'm not a pro with grunt but i have an angular js template that i want to use for my application i'm trying to make the browser open automaticaly when grunt is launched and reload page when html, js and css files are modified i added watch and…
Main Flow
  • 319
  • 2
  • 18
5
votes
2 answers

Grunt watch pattern.indexOf is not a function

I'm trying to use Grunt's grunt-contrib-watch plugin to watch some files and then run the tasks, just what it was made for, this is my Gruntfile.js module.exports = function(grunt){ grunt.initConfig({ pkg:…
Andrés Orozco
  • 2,490
  • 5
  • 32
  • 48
5
votes
3 answers

grunt-contrib-watch + sass: how to specify the destination files?

I have this workflow: module.exports = function(grunt) { require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks grunt.initConfig({ sass: { options: { sourceMap: true }, dist: { …
tirenweb
  • 30,963
  • 73
  • 183
  • 303
5
votes
2 answers

Is 'El Capitan's' rootless breaking old grunt configs?

After migrating to El Capitan, it seems users are experiencing an issue with grunt installations, possibly related to the rootless changes of El Capitan. In particular, running the grunt --force command results in EPERM errors. The workflow is as…
5
votes
3 answers

Use Grunt newer with custom task

I'm trying to use grunt-newer to watch files from a folder and if any is changed, trigger a custom task. I have something like this in my Gruntfile.js: grunt.initConfig({ watch: { widgets: { files: "/somepath/*.js", tasks:…
Christian Benseler
  • 7,907
  • 8
  • 40
  • 71
5
votes
1 answer

Grunt is Running "watch" task and Waiting... forever. Is it my Gruntfile.js syntax?

In anticipation of a Sassier Bootstrap 4, I'm (trying to) switch from Less to Sass on Bootstrap 3.3.5 and setting up the required Gruntfile.js file. I had no problem compiling Less but cannot get Grunt working with Sass, specifically, $ grunt and $…
Morgan
  • 151
  • 1
  • 2
  • 7
1 2
3
28 29