diff --git a/docs/docs/configuration-noderize.md b/docs/docs/configuration-noderize.md index bb6192f..e21ba2b 100644 --- a/docs/docs/configuration-noderize.md +++ b/docs/docs/configuration-noderize.md @@ -255,6 +255,20 @@ File to run when using `start` or `watch` command. This is relative to your project root. Add `dist/` before. +### `inspect` + +[boolean] Default: `false` + +Start the [Node debugger](https://nodejs.org/api/debugger.html) with Noderize. + +### `inspectChrome` + +[number] Default: _none_ + +Start the [Chrome DevTools (Node) debugger](https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js) with Noderize. + +Number given will be used as port to listen on. + ## Other Options ### `env` diff --git a/lerna.json b/lerna.json index b1bf19f..83ff557 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages": [ "packages/*" ], - "version": "0.7.1", + "version": "0.7.2", "npmClient": "yarn", "useWorkspaces": true } diff --git a/packages/create/package.json b/packages/create/package.json index 0bb99f5..c74ea10 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/Cretezy/Noderize.git" }, - "version": "0.7.1", + "version": "0.7.2", "license": "MIT", "bin": "dist/index.js", "files": [ @@ -26,13 +26,13 @@ "prepack": "npm run clean && npm run build -- --env production" }, "dependencies": { - "@noderize/runtime": "^0.7.1", + "@noderize/runtime": "^0.7.2", "consola": "^1.3.0", "fs-extra": "^5.0.0", "minimist": "^1.2.0" }, "devDependencies": { - "@noderize/scripts": "^0.7.1", + "@noderize/scripts": "^0.7.2", "source-map-support": "^0.5.5" } } diff --git a/packages/runtime/package.json b/packages/runtime/package.json index f7a83e2..8be582f 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/Cretezy/Noderize.git" }, - "version": "0.7.1", + "version": "0.7.2", "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0-beta.46" diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 24e3262..7b84fc3 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/Cretezy/Noderize.git" }, - "version": "0.7.1", + "version": "0.7.2", "license": "MIT", "bin": { "noderize-scripts": "dist/index.js" diff --git a/packages/scripts/src/options.js b/packages/scripts/src/options.js index 37f406c..896e96b 100644 --- a/packages/scripts/src/options.js +++ b/packages/scripts/src/options.js @@ -116,6 +116,14 @@ export function getOptions(rawArgs, env = null) { type: Object, default: {} }, + inspect: { + type: Boolean, + default: false + }, + inspectChrome: { + type: Number, + default: false + }, target: { type: String, default: "node", diff --git a/packages/scripts/src/scripts/start.js b/packages/scripts/src/scripts/start.js index 0c45a53..ea315d3 100644 --- a/packages/scripts/src/scripts/start.js +++ b/packages/scripts/src/scripts/start.js @@ -18,8 +18,23 @@ export async function start(options, nodePath = process.argv[0]) { return; } - const child = spawn(nodePath, [options.startFile, ...options.args._], { - execArgv: ["-r", "source-map-support/register"], + const args = [options.startFile, ...options.args._]; + const execArgv = ["-r", "source-map-support/register"]; + + // Enable V8 debugger + if (options.inspect) { + args.unshift("inspect"); + } + // Enable Chrome DevTools debugger + if (options.inspectChrome) { + execArgv.push( + `--inspect=${options.inspectChrome}` + ); + + } + console.log([...execArgv,...args]) + + const child = spawn(nodePath,[...execArgv,...args], { cwd: appDirectory, stdio: "inherit" });