Run grunt with debugger enabled (#8911)

* Run grunt with debugger enabled

When forking a node.js thread we are also having the possibility to pass some node.js arguments, such as "--inspect=0.0.0.0". By providing this, we are adding the capability of doing live debugging even when the system is started with grunt.

* removed whitespace

* Update Gruntfile.js
v1.18.x
Tudor-Dan Ravoiu 4 years ago committed by GitHub
parent f7f119d5cc
commit 39279a1e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -143,8 +143,17 @@ module.exports = function (grunt) {
if (worker) {
worker.kill();
}
const execArgv = [];
const inspect = process.argv.find(a => a.startsWith('--inspect'));
if (inspect) {
execArgv.push(inspect);
}
worker = fork('app.js', args, {
env: env,
env,
execArgv,
});
}

Loading…
Cancel
Save