gruntjs / grunt-contrib-watch

Run tasks whenever watched files change.
http://gruntjs.com/
MIT License
1.98k stars 356 forks source link

Interrupt does not work with grunt-requirejs or works and closes without error. #489

Open JeffHerb opened 8 years ago

JeffHerb commented 8 years ago

I'm having a strange bug, where watch tasks fail to detect/stop the current task build when changes are made/saved in files when the grunt-requirejs task is running. Overall my watch task is extremely quick so getting a change in before that task is very unlikely to happen. My watch settings are as follows:

options: {
    "spawn": false,
    "livereload": true,
    "interrupt": true
}

Here is the real twist, if I simply change the order of my options around a bit, I can get the interrupt to detect the change, but it will first finish the requireJS build, and it will then rebuild the entire task and grunt will simply stop without an error. Grunt does report "Done, without errors"

new order:

options: {
    "interrupt": true,
    "spawn": false,
    "livereload": true
}

Please note, i can not set spawn to true as I have other tasks building dynamic settings in the background. If spawn is set to true, all those dynamic settings are lost.