{"action":"created","issue":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/186","labels_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/186/comments","events_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/186/events","html_url":"https://github.com/gruntjs/grunt-contrib-watch/issues/186","id":18242592,"number":186,"title":"Let livereload not wait for certain watches","user":{"login":"mzgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=3","gravatar_id":"","url":"https://api.github.com/users/mzgol","html_url":"https://github.com/mzgol","followers_url":"https://api.github.com/users/mzgol/followers","following_url":"https://api.github.com/users/mzgol/following{/other_user}","gists_url":"https://api.github.com/users/mzgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgol/subscriptions","organizations_url":"https://api.github.com/users/mzgol/orgs","repos_url":"https://api.github.com/users/mzgol/repos","events_url":"https://api.github.com/users/mzgol/events{/privacy}","received_events_url":"https://api.github.com/users/mzgol/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/milestones/4","labels_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/milestones/4/labels","id":594599,"number":4,"title":"0.7.0","description":"","creator":{"login":"shama","id":99604,"avatar_url":"https://avatars.githubusercontent.com/u/99604?v=3","gravatar_id":"","url":"https://api.github.com/users/shama","html_url":"https://github.com/shama","followers_url":"https://api.github.com/users/shama/followers","following_url":"https://api.github.com/users/shama/following{/other_user}","gists_url":"https://api.github.com/users/shama/gists{/gist_id}","starred_url":"https://api.github.com/users/shama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shama/subscriptions","organizations_url":"https://api.github.com/users/shama/orgs","repos_url":"https://api.github.com/users/shama/repos","events_url":"https://api.github.com/users/shama/events{/privacy}","received_events_url":"https://api.github.com/users/shama/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2014-03-12T05:42:47Z","updated_at":"2014-07-24T22:54:20Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2013-08-19T14:31:26Z","updated_at":"2015-01-30T10:17:11Z","closed_at":null,"body":"I use `grunt-contrib-watch` together with the [grunt-karma](https://github.com/karma-runner/grunt-karma) task. Unfortunately, the `watch` task waits for all watches to finish executing which is painfully slow with lots of unit tests. I'd like the livereload to not wait for this particular task to finish as this is not a pre-processor and it doesn't influence what's going to the browser.\r\n\r\nPreferably, watches should have option to set a flag `preprocessor` (by default `true`). When set to `false`, livereload should not wait for this watch task to finish."},"comment":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/comments/72180420","html_url":"https://github.com/gruntjs/grunt-contrib-watch/issues/186#issuecomment-72180420","issue_url":"https://api.github.com/repos/gruntjs/grunt-contrib-watch/issues/186","id":72180420,"user":{"login":"laskos","id":8137000,"avatar_url":"https://avatars.githubusercontent.com/u/8137000?v=3","gravatar_id":"","url":"https://api.github.com/users/laskos","html_url":"https://github.com/laskos","followers_url":"https://api.github.com/users/laskos/followers","following_url":"https://api.github.com/users/laskos/following{/other_user}","gists_url":"https://api.github.com/users/laskos/gists{/gist_id}","starred_url":"https://api.github.com/users/laskos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laskos/subscriptions","organizations_url":"https://api.github.com/users/laskos/orgs","repos_url":"https://api.github.com/users/laskos/repos","events_url":"https://api.github.com/users/laskos/events{/privacy}","received_events_url":"https://api.github.com/users/laskos/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T10:17:11Z","updated_at":"2015-01-30T10:17:11Z","body":"This is temporary solution, that works for me:\r\n\r\n##### Install Livereload server:\r\n\r\n```bash\r\n$ npm install tiny-lr --save-dev\r\n```\r\n\r\n##### Define livereload task in Gruntfile.js:\r\n\r\n```javascript\r\nvar lrserver = require('tiny-lr')();\r\n\r\ntry {\r\n    lrserver.listen(35729, function() {\r\n        console.log('Livereload Server Started');\r\n    });\r\n} catch(e) {\r\n    console.log('Error during starting Livereload Server');\r\n}\r\n\r\ngrunt.registerTask('livereload', function() {\r\n    lrserver.changed({body:{files:['index.html']}}); // It's really no metter what's changed\r\n});\r\n```\r\n\r\n##### Add livereload task in watch config:\r\n```javascript\r\ngrunt.initConfig({\r\n    watch: {\r\n        karma: {\r\n            files: [\r\n                'src/js/**/*.js',\r\n                'src/tests/**/*.test.js',\r\n            ],\r\n            tasks: ['livereload', 'karma:run'],\r\n            options: {\r\n                spawn: false // It's important!\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n"}}