fix(vite): externalise #_config in ssr: false (#3899)

This commit is contained in:
Daniel Roe 2022-03-25 12:18:57 +00:00 committed by GitHub
parent 9e67d58005
commit 38e92597f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,