From 38e92597f40c8b4d210c891d7161de7fa38fe45d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 25 Mar 2022 12:18:57 +0000 Subject: [PATCH] fix(vite): externalise `#_config` in `ssr: false` (#3899) --- packages/vite/src/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index c177a8d3f1..539e1b6c13 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -40,8 +40,6 @@ export async function buildServer (ctx: ViteBuildContext) { } }, ssr: { - // Private nitro alias: packages/nitro/src/rollup/config.ts#L234 - external: ['#_config'], noExternal: [ ...ctx.nuxt.options.build.transpile, // TODO: Use externality for production (rollup) build @@ -57,6 +55,8 @@ export async function buildServer (ctx: ViteBuildContext) { outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'), ssr: ctx.nuxt.options.ssr ?? true, rollupOptions: { + // Private nitro alias: packages/nitro/src/rollup/config.ts#L234 + external: ['#_config'], output: { entryFileNames: 'server.mjs', preferConst: true,