mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
perf(nuxt): avoid watching nested paths (#21256)
This commit is contained in:
parent
bc38ee058f
commit
a302fe8062
@ -116,7 +116,7 @@ function createGranularWatcher () {
|
|||||||
watchers[path].close()
|
watchers[path].close()
|
||||||
delete watchers[path]
|
delete watchers[path]
|
||||||
}
|
}
|
||||||
if (event === 'addDir' && path !== dir && !ignoredDirs.has(path) && !(path in watchers) && !isIgnored(path)) {
|
if (event === 'addDir' && path !== dir && !ignoredDirs.has(path) && !pathsToWatch.includes(path) && !(path in watchers) && !isIgnored(path)) {
|
||||||
watchers[path] = chokidar.watch(path, { ...nuxt.options.watchers.chokidar, ignored: [isIgnored] })
|
watchers[path] = chokidar.watch(path, { ...nuxt.options.watchers.chokidar, ignored: [isIgnored] })
|
||||||
watchers[path].on('all', (event, path) => nuxt.callHook('builder:watch', event, normalize(path)))
|
watchers[path].on('all', (event, path) => nuxt.callHook('builder:watch', event, normalize(path)))
|
||||||
nuxt.hook('close', () => watchers[path].close())
|
nuxt.hook('close', () => watchers[path].close())
|
||||||
|
@ -357,6 +357,7 @@ export default defineUntypedSchema({
|
|||||||
'**/*.d.ts', // ignore type declarations
|
'**/*.d.ts', // ignore type declarations
|
||||||
'.output',
|
'.output',
|
||||||
'.git',
|
'.git',
|
||||||
|
'.cache',
|
||||||
await get('analyzeDir'),
|
await get('analyzeDir'),
|
||||||
await get('buildDir'),
|
await get('buildDir'),
|
||||||
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
||||||
|
Loading…
Reference in New Issue
Block a user