mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
chore(cli): Show config diff only with DEBUG
This commit is contained in:
parent
8ffb15200e
commit
ac9c0b044e
@ -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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user