From f8cb2586cfd509482705a8bc46ccdee7052dd931 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 13 Apr 2021 00:06:27 +0200 Subject: [PATCH] perf(nitro): externalize buildDir in development TODO: supporting ignore patterns to include/exclude (rootDir but not buildDir) --- packages/nitro/src/rollup/config.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/nitro/src/rollup/config.ts b/packages/nitro/src/rollup/config.ts index 702149adb5..8b58fa9f30 100644 --- a/packages/nitro/src/rollup/config.ts +++ b/packages/nitro/src/rollup/config.ts @@ -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