diff --git a/packages/nuxt/src/core/builder.ts b/packages/nuxt/src/core/builder.ts index 80b96abd8e..a8b7591e04 100644 --- a/packages/nuxt/src/core/builder.ts +++ b/packages/nuxt/src/core/builder.ts @@ -99,7 +99,7 @@ function createGranularWatcher () { let pending = 0 - const ignoredDirs = new Set([...nuxt.options.modulesDir, nuxt.options.buildDir]) + const ignoredDirs = new Set(nuxt.options.modulesDir) const pathsToWatch = nuxt.options._layers.map(layer => layer.config.srcDir || layer.cwd).filter(d => d && !isIgnored(d)) for (const pattern of nuxt.options.watch) { if (typeof pattern !== 'string') { continue } diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 013a1da6fb..22669a0067 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -347,7 +347,7 @@ export default defineUntypedSchema({ '**/*.d.{cts,mts,ts}', // ignore type declarations '**/.{pnpm-store,vercel,netlify,output,git,cache,data}', relative(await get('rootDir'), await get('analyzeDir')), - relative(await get('rootDir'), await get('buildDir')), + relative(await get('rootDir'), join(await get('buildDir'), '**/*')), await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*` ].concat(val).filter(Boolean) },