perf(nitro): externalize buildDir in development

TODO: supporting ignore patterns to include/exclude (rootDir but not buildDir)
This commit is contained in:
Pooya Parsa 2021-04-13 00:06:27 +02:00
parent b5c77b4c6b
commit f8cb2586cf

View File

@ -208,10 +208,14 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
moduleDirectories,
ignore: [
nitroContext._internal.runtimeDir,
...(nitroContext._nuxt.dev ? [] : [nitroContext._nuxt.buildDir]),
...nitroContext.middleware.map(m => m.handle),
nitroContext._nuxt.rootDir,
nitroContext._nuxt.serverDir
...((!nitroContext._nuxt.dev && [
// prod
nitroContext._nuxt.srcDir,
nitroContext._nuxt.rootDir,
nitroContext._nuxt.buildDir
]) || []),
nitroContext._nuxt.serverDir,
...nitroContext.middleware.map(m => m.handle)
],
traceOptions: {
base: nitroContext._nuxt.rootDir