fix(vite): externalize config at rollup, not ssr level (#2971)

This commit is contained in:
Daniel Roe 2022-01-31 10:54:48 +00:00 committed by GitHub
parent 33f6c3ef74
commit b110c8c96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,6 @@ export async function buildServer (ctx: ViteBuildContext) {
}
},
ssr: {
external: ['#config'],
noExternal: [
...ctx.nuxt.options.build.transpile,
// TODO: Use externality for production (rollup) build
@ -63,6 +62,7 @@ export async function buildServer (ctx: ViteBuildContext) {
preferConst: true,
format: 'module'
},
external: ['#config'],
onwarn (warning, rollupWarn) {
if (!['UNUSED_EXTERNAL_IMPORT'].includes(warning.code)) {
rollupWarn(warning)