mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(schema): only deoptimise buildDir watcher if needed
This commit is contained in:
parent
98cb82ee3a
commit
e2fa41030d
@ -341,15 +341,20 @@ export default defineUntypedSchema({
|
|||||||
* inside the `ignore` array will be ignored in building.
|
* inside the `ignore` array will be ignored in building.
|
||||||
*/
|
*/
|
||||||
ignore: {
|
ignore: {
|
||||||
$resolve: async (val, get) => [
|
$resolve: async (val, get) => {
|
||||||
'**/*.stories.{js,cts,mts,ts,jsx,tsx}', // ignore storybook files
|
const buildDir = relative(await get('rootDir'), await get('buildDir'))
|
||||||
'**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}', // ignore tests
|
const shouldDeoptimiseBuildWatcher = val && Array.isArray(val) && val.some(pattern => typeof pattern === 'string' && pattern.includes('!' + buildDir))
|
||||||
'**/*.d.{cts,mts,ts}', // ignore type declarations
|
|
||||||
'**/.{pnpm-store,vercel,netlify,output,git,cache,data}',
|
return [
|
||||||
relative(await get('rootDir'), await get('analyzeDir')),
|
'**/*.stories.{js,cts,mts,ts,jsx,tsx}', // ignore storybook files
|
||||||
relative(await get('rootDir'), join(await get('buildDir'), '**/*')),
|
'**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}', // ignore tests
|
||||||
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
'**/*.d.{cts,mts,ts}', // ignore type declarations
|
||||||
].concat(val).filter(Boolean)
|
'**/.{pnpm-store,vercel,netlify,output,git,cache,data}',
|
||||||
|
relative(await get('rootDir'), await get('analyzeDir')),
|
||||||
|
shouldDeoptimiseBuildWatcher ? relative(await get('rootDir'), join(await get('buildDir'), '**/*')) : buildDir,
|
||||||
|
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
||||||
|
].concat(val).filter(Boolean)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user