fix(vite): resolve #_config in base plugin (#3848)

This commit is contained in:
Daniel Roe 2022-03-23 08:10:12 +00:00 committed by GitHub
parent 8bb02be218
commit 93c4dfe091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

View File

@ -40,6 +40,7 @@ export const DynamicBasePlugin = createUnplugin(function (options: DynamicBasePl
if (id.startsWith('/__NUXT_BASE__')) { if (id.startsWith('/__NUXT_BASE__')) {
return id.replace('/__NUXT_BASE__', '') return id.replace('/__NUXT_BASE__', '')
} }
if (id === '#_config') { return '#_config' }
return null return null
}, },
enforce: 'post', enforce: 'post',

View File

@ -62,7 +62,6 @@ export async function buildServer (ctx: ViteBuildContext) {
preferConst: true, preferConst: true,
format: 'module' format: 'module'
}, },
external: ['#config'],
onwarn (warning, rollupWarn) { onwarn (warning, rollupWarn) {
if (!['UNUSED_EXTERNAL_IMPORT'].includes(warning.code)) { if (!['UNUSED_EXTERNAL_IMPORT'].includes(warning.code)) {
rollupWarn(warning) rollupWarn(warning)

View File

@ -82,7 +82,7 @@ export async function bundle (nuxt: Nuxt) {
] ]
} }
} }
}, } as ViteOptions,
nuxt.options.vite nuxt.options.vite
) )
} }