diff --git a/.grunt/tasks/watch.js b/.grunt/tasks/watch.js index 25c64876c71..607df77f688 100644 --- a/.grunt/tasks/watch.js +++ b/.grunt/tasks/watch.js @@ -49,6 +49,10 @@ module.exports = grunt => { // Spawn the task in a child process so that it doesn't kill this one // if it failed. + var args = [task, filesOption]; + if (grunt.option('force')) { + args.push('--force'); + } grunt.util.spawn( { // Spawn with the grunt bin. @@ -58,7 +62,7 @@ module.exports = grunt => { cwd: grunt.moodleEnv.fullRunDir, stdio: 'inherit' }, - args: [task, filesOption] + args: args }, function(err, res, code) { if (code !== 0) { diff --git a/.upgradenotes/MDL-86839-2026031306053508.yml b/.upgradenotes/MDL-86839-2026031306053508.yml new file mode 100644 index 00000000000..fee7888d861 --- /dev/null +++ b/.upgradenotes/MDL-86839-2026031306053508.yml @@ -0,0 +1,10 @@ +issueNumber: MDL-86839 +notes: + core: + - message: > + "grunt watch" now accepts a force flag. Run "grunt watch -f" or "grunt + watch --force" to prevent grunt from cancelling builds when errors + occur. This is especially useful during development, because js build + files will be built even if, for example, jslint errors are still + present in the files. + type: improved