mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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()
|
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) => {
|
const unsub = currentNuxt.hooks.hook('restart', async (options) => {
|
||||||
unsub() // we use this instead of `hookOnce` for Nuxt Bridge support
|
unsub() // we use this instead of `hookOnce` for Nuxt Bridge support
|
||||||
if (options?.hard) { return hardRestart() }
|
if (options?.hard) { return hardRestart() }
|
||||||
@ -156,6 +151,12 @@ export default defineNuxtCommand({
|
|||||||
writeTypes(currentNuxt).catch(console.error),
|
writeTypes(currentNuxt).catch(console.error),
|
||||||
buildNuxt(currentNuxt)
|
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)
|
currentHandler = toNodeListener(currentNuxt.server.app)
|
||||||
if (isRestart && args.clear !== false) {
|
if (isRestart && args.clear !== false) {
|
||||||
showBanner()
|
showBanner()
|
||||||
|
Loading…
Reference in New Issue
Block a user