diff --git a/packages/cli/src/commands/dev.ts b/packages/cli/src/commands/dev.ts index 9e57dde13c..ff40a0c3ed 100644 --- a/packages/cli/src/commands/dev.ts +++ b/packages/cli/src/commands/dev.ts @@ -24,25 +24,27 @@ export async function invoke (args) { const newNuxt = await loadNuxt({ rootDir, dev: true, ready: false }) - let configChanges - if (currentNuxt) { - configChanges = diff(currentNuxt.options, newNuxt.options, [ - 'generate.staticAssets.version', - 'env.NITRO_PRESET' - ]) - server.setApp(createLoadingHandler('Restarting...', 1)) - await currentNuxt.close() - currentNuxt = newNuxt - } else { - currentNuxt = newNuxt - } - - if (configChanges) { - if (configChanges.length) { - info('Nuxt config updated:') - printDiff(configChanges) + if (process.env.DEBUG) { + let configChanges + if (currentNuxt) { + configChanges = diff(currentNuxt.options, newNuxt.options, [ + 'generate.staticAssets.version', + 'env.NITRO_PRESET' + ]) + server.setApp(createLoadingHandler('Restarting...', 1)) + await currentNuxt.close() + currentNuxt = newNuxt } else { - info('Restarted nuxt due to config changes') + currentNuxt = newNuxt + } + + if (configChanges) { + if (configChanges.length) { + info('Nuxt config updated:') + printDiff(configChanges) + } else { + info('Restarted nuxt due to config changes') + } } }