grunt-contrib-watch

How to run two grunt watch tasks simultaneously

ⅰ亾dé卋堺 提交于 2019-11-28 15:57:32
Is it possible to run two watch tasks simultaneously? I understand that I can have any number of tasks I want inside watch settings and just launch grunt watch and it will watch all of them, like this ... watch: { A: { files: "js/dev/**/*.coffee", tasks: ["coffee", "requirejs"] }, B: { files: "js/dev/**/*.coffee", tasks: ["coffee"] }, C: { files: "js/dev/**/*.html", tasks: ["copy"] } } ... ...but I don't need this. I just want to have different set of tasks for development and production. As you can guess, the only difference between A (production) and B (development) is minification and

Why does sass fail to compile with grunt command error of “index is 2 but list is only 1 item long for `nth'”?

a 夏天 提交于 2019-11-28 12:41:38
问题 After inheriting a project using Grunt, I am running grunt via terminal, waiting for the 'Watching...' make the change to the scss, and terminal recognizes the change but the compilation fails in the next step of compass:dev. Here is what it's showing inside terminal: Waiting... >> File "../sass/inside.scss" changed. Running "compass:dev" (compass) task unchanged ../img/common/1x-scb9effd9a6.png unchanged ../img/common/2x-s7bf9cb0f59.png error /Applications/MAMP/htdocs/Repos/wp-content/themes

Replace all the text with specified replacement using grunt replace

為{幸葍}努か 提交于 2019-11-28 11:55:38
问题 I have a .html file which contains id="fixedtext", I want to replace all these id with id="uniquetext" the grunt-text-replace just replaces the first id it finds and doesnot parse the entire text. Any idea how can I make either grunt-text-replace https://github.com/yoniholmes/grunt-text-replace or grunt-replace https://www.npmjs.com/package/grunt-replace to do this for the entire document and not just for the first occurrence. replace: { dist: { options:{ patterns:[{ match:'id="fixedtext"',

How to modify grunt watch tasks based on the file changed?

梦想的初衷 提交于 2019-11-28 09:28:42
I'm writing a node.js program that will watch a directory filled with a large (300-ish) amount of scss projects. Grunt-watch (run either through the node module or on its own, whatever works) will be configured so that whenever a scss file is changed, it will be compiled with compass, the output file moved to a separate directory, for example: ./1234/style.scss was changed >> grunt-watch runs grunt-compass >> /foo/bar/baz/1234/style.css updated The project directory that the file was in is obviously very important (if grunt-compass sent all the compiled files to the same directory, they would

grunt throw “Recursive process.nextTick detected”

倾然丶 夕夏残阳落幕 提交于 2019-11-28 03:52:50
I'm running Lion 10.9.2 with nodejs v0.10.26 I want to setup an automated compilation on sass files and a live reload with grunt, nothing complicated but... When running grunt watch I get the following error (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. util.js:35 var str = String(f).replace(formatRegExp, function(x) { ^ RangeError: Maximum call stack size exceeded here is the Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON(

Troubles with NPM and node-gyp in Windows

こ雲淡風輕ζ 提交于 2019-11-28 01:20:38
问题 I have some troubles with npm packages on my Windows workstation... I have a set of NPM dependencies in my package.json file: "devDependencies": { "babel-plugin-transform-react-jsx": "^6.2.0", "babel-preset-es2015": "^6.1.18", "babel-preset-react": "^6.1.18", "grunt": "^0.4.5", "grunt-babel": "^6.0.0", "grunt-contrib-connect": "^0.11.2", "grunt-contrib-jasmine": "^0.9.2", "grunt-contrib-sass": "^0.9.2", "grunt-contrib-watch": "^0.6.1", "grunt-exec": "^0.4.6", "grunt-template-jasmine-requirejs

How to run two grunt watch tasks simultaneously

蹲街弑〆低调 提交于 2019-11-27 19:51:07
问题 Is it possible to run two watch tasks simultaneously? I understand that I can have any number of tasks I want inside watch settings and just launch grunt watch and it will watch all of them, like this ... watch: { A: { files: "js/dev/**/*.coffee", tasks: ["coffee", "requirejs"] }, B: { files: "js/dev/**/*.coffee", tasks: ["coffee"] }, C: { files: "js/dev/**/*.html", tasks: ["copy"] } } ... ...but I don't need this. I just want to have different set of tasks for development and production. As