mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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()
|
||||
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].on('all', (event, path) => nuxt.callHook('builder:watch', event, normalize(path)))
|
||||
nuxt.hook('close', () => watchers[path].close())
|
||||
|
@ -357,6 +357,7 @@ export default defineUntypedSchema({
|
||||
'**/*.d.ts', // ignore type declarations
|
||||
'.output',
|
||||
'.git',
|
||||
'.cache',
|
||||
await get('analyzeDir'),
|
||||
await get('buildDir'),
|
||||
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
||||
|
Loading…
Reference in New Issue
Block a user