From 01ae56bda64eeeca83775098d1104141747b7e8c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 23 Aug 2022 14:43:34 +0100 Subject: [PATCH 1/2] fix(nuxt): pass analyze options through to nitro --- packages/nuxt/src/core/nitro.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 2de2d3db6ca..aaccd6e96ba 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -22,6 +22,7 @@ export async function initNitro (nuxt: Nuxt) { dev: nuxt.options.dev, preset: nuxt.options.dev ? 'nitro-dev' : undefined, buildDir: nuxt.options.buildDir, + analyze: nuxt.options.build.analyze, scanDirs: nuxt.options._layers.map(layer => layer.config.srcDir).filter(Boolean).map(dir => join(dir!, 'server')), renderer: resolve(distDir, 'core/runtime/nitro/renderer'), errorHandler: resolve(distDir, 'core/runtime/nitro/error'), From dae818e621e2b1b51336cd771521578401b571a9 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 23 Aug 2022 14:47:28 +0100 Subject: [PATCH 2/2] fix: hard code default analyze (for webpack case) --- packages/nuxt/src/core/nitro.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index aaccd6e96ba..fcdeeedea7e 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -22,7 +22,11 @@ export async function initNitro (nuxt: Nuxt) { dev: nuxt.options.dev, preset: nuxt.options.dev ? 'nitro-dev' : undefined, buildDir: nuxt.options.buildDir, - analyze: nuxt.options.build.analyze, + analyze: nuxt.options.build.analyze && { + template: 'treemap', + projectRoot: nuxt.options.rootDir, + filename: join(nuxt.options.rootDir, '.nuxt/stats', '{name}.html') + }, scanDirs: nuxt.options._layers.map(layer => layer.config.srcDir).filter(Boolean).map(dir => join(dir!, 'server')), renderer: resolve(distDir, 'core/runtime/nitro/renderer'), errorHandler: resolve(distDir, 'core/runtime/nitro/error'),