grunt-contrib-watch

Can the gruntjs watch be restarted on grunt.js file change

亡梦爱人 提交于 2020-01-23 04:39:09
问题 Can the grunt watch be restarted when ever there is a change in grunt.js file use case: I am right now in the process of building my grunt process and keep changing the grunt.js file and I have to restart the grunt.js to see if it works. 回答1: It looks like this was implemented in version 0.4.0 . You can see the issue here which explains that by simply watching the Gruntfile (even without any tasks) the entire contents of the Grunt setup will be reloaded: watch: { grunt: { files: ['grunt.js']

sails.js less livereload with grunt watch not working

不问归期 提交于 2020-01-05 09:07:08
问题 I got my less files compiled in css perfectly by grunt and I see result in .tmp/public/styles So now livereload with grunt-contrib-watch should be made naturally in sails generated project ? Or do I have to make a special configuration ? I found that in tasks/pipeline.js file but not sure of what to do. // CSS files to inject in order // // (if you're using LESS with the built-in default config, you'll want // to change `assets/styles/importer.less` instead.) var cssFilesToInject = [ 'styles/

Grunt compile all .less to .css in each directory

馋奶兔 提交于 2020-01-04 14:16:40
问题 So I have setup my site to use modules, in which each module has it's own .less file which needs to be compiled into .css. Folder Structure: /common/modules/{module-name}/style.less I need all the style.less files to be converted into style.css files in the same directory. For example: /common/modules/clock/style.less would need to be compiled to /common/modules/clock/style.css I don't want to have to add each of the modules individually to my grunt file, is there a way to do this dynamically

Get livereload to work with Sails.js

别等时光非礼了梦想. 提交于 2019-12-29 06:25:17
问题 I am new to both Sails and grunt so I might be missing the obvious. I am trying to automatically refresh my sails app in the browser whenever files change . I start the app with sails lift and it runs on the default port 1337 . I tried adding options: {livereload:true} to my grunt-contrib-watch configuration but as far as I understand I need to somehow inject the livereload JavaScript into my page? I tried to use grunt-contrib-connect with the livereload option to inject the JavaScript but it

grunt throw “Recursive process.nextTick detected”

喜你入骨 提交于 2019-12-28 08:06:31
问题 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

imagemin for gruntjs used with watch for grunt not properly watching my files

↘锁芯ラ 提交于 2019-12-24 13:02:48
问题 What I would like is the watcher to watch any newly added images and compress ONLY the newly added ones. I would also want it to remove the images I remove from the uncompressed folder (which is images/images/ ), also in the compressed one which is ( images/build/ ), but this doesn't happen. What happens now is, anytime I add an image, Grunt recompresses them all (as in this screenshot: where I added two new images, and it recompresses the whole folder) and if I remove an image from the

grunt dynamic task on watch event

别等时光非礼了梦想. 提交于 2019-12-24 12:33:44
问题 Hi i have a problem i need to watch less tasks for different directory. I need a method to edit the less task and instead to duplicate them i need to use a variable dir inside it. there is my code: module.exports = function(grunt) { grunt.initConfig({ pkg : grunt.file.readJSON('package.json'), dirLess : 'less', dirCss : 'css', dirImages : 'images', dirDT : 'theme-cdt', dirPB : 'theme-cpb', dirMCS : 'theme-cmcs', dirSprites : '<%= dirImages %>/sprites', dirIconFont : './fonts', dirCssMin : '<%

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

不想你离开。 提交于 2019-12-22 06:58:13
问题 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 follows: Assuming npm has been installed, navigate to the grunt directory with package.json and gruntfile.js and invoke grunt: grunt --force Example Gruntfile.js file contents: module.exports = function(grunt) { // All configuration goes here grunt

Grunt - how to watch and synchronize files' deletion

半城伤御伤魂 提交于 2019-12-21 20:55:25
问题 I am a new user of Grunt. Currently I have a folder static_src/img that contains image source files (.psd) and image files (.png, .jpg, etc.). This folder is not public. Instead, I want to sync the change of only image files to another public folder static/img . The problem is - it works well when I add/change a image file in static_src/img , but I don't know how to sync the change when I delete a file. Grunt-contrib-watch can detect the deletion in static_src/img , but I don't know how to

grunt-express-server with contrib-watch

南笙酒味 提交于 2019-12-19 04:04:37
问题 I am trying to use both grunt-express-server and grunt-contrib-watch however, as soon as my express server starts, it no longer seems to do any watching or reloading. I have the server setup to spawn in the background. My project is here: https://github.com/RyanHirsch/firem Here is my Gruntfile.js module.exports = function(grunt) { require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ watch: { options: { livereload: true, }, express: { files: [ 'index.html', 'server