grunt-contrib-watch

Make watch not break down on error thrown by grunt-express-server

时光怂恿深爱的人放手 提交于 2019-12-11 09:48:18
问题 I use Yeoman to do some angular development with grunt, livereload etc. I've also set up a basic node.js/express app and I'm sharing some JS between the client (angular) and the server (node) using grunt-contrib-copy and grunt-express-server that fires on every file-save using watch. So far so good! The problem is if I introduce a syntax error into the code that I want to share with node and hit save. The syntax error gets shown in the log and breaks/stops the watch. Then I have to go restart

Grunt watch Running “watch” task Waiting

白昼怎懂夜的黑 提交于 2019-12-11 02:17:26
问题 I have a problem with grunt-watch. When I use "grunt" in terminal outputs "Running "watch" task Waiting..." krp-arina@krparina-Lenovo-G555:~/server$ grunt Running "watch" task Waiting... krp-arina@krparina-Lenovo-G555:~/server$ grunt -v Initializing Command-line options: --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering "grunt-contrib-less" local Npm module tasks. Reading /home/krp-arina/server/node_modules/grunt-contrib-less/package.json...OK Parsing

Is it possible to run a task after the watch task?

冷暖自知 提交于 2019-12-10 17:08:57
问题 I have a PHP-based project that won't run on grunt-php. Instead, I use grunt-exec to run my MAMP server for development. exec: { serverup: { command: '/Applications/MAMP/bin/start.sh' }, serverdown: { command: '/Applications/MAMP/bin/stop.sh' } } In my custom development task, I run the MAMP start script just before my watch task. Then, I'm trying to stop the MAMP server after I've exited the watch task. grunt.registerTask('default', ['jshint', 'concat', 'compass:dev', 'exec:serverup', 'watch

Getting karma server to launch upon grunt watch

為{幸葍}努か 提交于 2019-12-10 10:34:30
问题 While developing, I'm using karma and grunt to watch for file changes and run the tests. In command line, I'd like to be able to simply enter $ grunt watch and have the karma server to start once, and thereafter having grunt watching for changes and running the various tasks (including karma tests) whenever files change. I don't want to enter $ karma start . How can this be achieved? 回答1: Option #1 One can use the atBegin option of grunt-contrib-watch . The idea is to introduce a startup task

grunt watch & connect

試著忘記壹切 提交于 2019-12-09 04:34:21
问题 I am kinda new to grunt and want to use it with Jekyll and some LESS-compiling. My problem now is, I already have fully functioning LESS-comipiling with live reload and watch task and can build my jekyll site through grunt, but how do I run something like the jekyll serve or grunt-connect and grunt watch simultaneously? I want a grunt task that provides the watching of my LESS-files etc, builds the jekyll site and then runs a small web server with grunt-connect or whatever. My Gruntfile.js so

Watching files for changes on Vagrant, file modification times not updating

白昼怎懂夜的黑 提交于 2019-12-08 01:10:33
问题 We're trying out Vagrant. We have a web application directory on the host shared with the guest via NFS. While developing the website we quickly started to hit issues. We are running gulp-watch to spot changes to stylesheet and javascript files and run tasks, but changes were not being picked up for up to one minute. Also, Laravel was not noticing that blade templates were being changed, and so was not recompiling them and the old view templates were being shown. I eventually boiled down the

How to get grunt-watch to live reload HTML changes under different build tasks

北战南征 提交于 2019-12-07 16:40:47
问题 I can easily set up my Grunt file to live reload HTML and SCSS changes by doing something like: watch: { options: { livereload: true, }, css: { files: ['scss/*.scss'], tasks: ['compass'] }, html: { files: ['index.html'], tasks: ['build'] } } However, I have a build task for dev environment: dev , and a build task for production environment: build . Therefore, calling build when the HTML is changed will build the site for production which is not what I want if I only want the dev version.

grunt-contrib-watch causing Maximum call stack size exceeded

不羁岁月 提交于 2019-12-07 15:39:39
问题 When I execute the clean task (grunt clean), everything works as expected but when I run the watch task (grunt test), I get the following error: util.js:35 var str = String(f).replace(formatRegExp, function(x) { ^ RangeError: Maximum call stack size exceeded Here's my gruntfile module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') clean: ['tmpDir/'] watch: options: spawn: false src: tasks: ['clean'] files: [ src: 'client/assets/strings/en/str.coffee' ] #

Grunt.js: Fire livereload as soon a files are modified, before task completes

ⅰ亾dé卋堺 提交于 2019-12-07 13:44:52
问题 I'm using Grunt to compile my CSS with compass and trigger the browser livereload. These are my watch tasks: watch: { styles: { options: { spawn: false, }, files: [assetsDir + '/**/*.scss', '!**/*.{dev,min}.scss'], tasks: [ 'concat:styles', 'compass:styles', 'imagemin:styles', 'cssmin:styles', 'clean:styles', ], }, scripts: { options: { spawn: false, }, files: [assetsDir + '/**/*.js', '!**/*.{dev,min}.js'], tasks: [ 'concat:scripts', 'uglify:scripts', ], }, livereload: { options: { livereload

When I run Grunt, I receive the following message: Local npm module “grunt-contrib-copy” not found. Is it installed?

家住魔仙堡 提交于 2019-12-07 02:59:25
问题 I have been trying to install Grunt. When I run grunt I receive the following list of messages and warnings: Local Npm module "grunt-contrib-copy" not found. Is it installed? Local Npm module "grunt-contrib-uglify" not found. Is it installed? Local Npm module "grunt-contrib-jshint" not found. Is it installed? Local Npm module "grunt-contrib-less" not found. Is it installed? Local Npm module "grunt-contrib-clean" not found. Is it installed? Local Npm module "grunt-contrib-watch" not found. Is