mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxi): only watch distDir
after first build (#22614)
This commit is contained in:
parent
817c12f026
commit
4e409614e8
@ -134,11 +134,6 @@ export default defineNuxtCommand({
|
||||
|
||||
await currentNuxt.ready()
|
||||
|
||||
distWatcher = chokidar.watch(resolve(currentNuxt.options.buildDir, 'dist'), { ignoreInitial: true, depth: 0 })
|
||||
distWatcher.on('unlinkDir', () => {
|
||||
dLoad(true, '.nuxt/dist directory has been removed')
|
||||
})
|
||||
|
||||
const unsub = currentNuxt.hooks.hook('restart', async (options) => {
|
||||
unsub() // we use this instead of `hookOnce` for Nuxt Bridge support
|
||||
if (options?.hard) { return hardRestart() }
|
||||
@ -156,6 +151,12 @@ export default defineNuxtCommand({
|
||||
writeTypes(currentNuxt).catch(console.error),
|
||||
buildNuxt(currentNuxt)
|
||||
])
|
||||
|
||||
distWatcher = chokidar.watch(resolve(currentNuxt.options.buildDir, 'dist'), { ignoreInitial: true, depth: 0 })
|
||||
distWatcher.on('unlinkDir', () => {
|
||||
dLoad(true, '.nuxt/dist directory has been removed')
|
||||
})
|
||||
|
||||
currentHandler = toNodeListener(currentNuxt.server.app)
|
||||
if (isRestart && args.clear !== false) {
|
||||
showBanner()
|
||||
|
Loading…
Reference in New Issue
Block a user