diff --git a/packages/cli/src/commands/dev.ts b/packages/cli/src/commands/dev.ts index a3c6341f0..a6dcd5cc5 100644 --- a/packages/cli/src/commands/dev.ts +++ b/packages/cli/src/commands/dev.ts @@ -63,8 +63,14 @@ const command: GluegunCommand = { await toolbox.cms.invokeRefreshCMS(); await toolbox.languages.invokeRefreshLanguages(); - // for debug: node --inspect node_modules/.bin/nuxt - await spawn("yarn nuxt", { + const debugOn = toolbox.parameters.options.debug; + + let spawnCommand = "yarn nuxt"; + if (debugOn) { + spawnCommand = "node --inspect node_modules/.bin/nuxt"; + } + + await spawn(spawnCommand, { stdio: "inherit", }); },