From 98cb82ee3a0055e481936c34687b124b58c36a5e Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 30 Oct 2023 18:17:53 +0900 Subject: [PATCH] fix(nuxt,schema): ignore files in `buildDir` but not dir itself --- packages/nuxt/src/core/builder.ts | 2 +- packages/schema/src/config/common.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) },