mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(vite): resolve #_config
in base plugin (#3848)
This commit is contained in:
parent
8bb02be218
commit
93c4dfe091
@ -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',
|
||||||
|
@ -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)
|
||||||
|
@ -82,7 +82,7 @@ export async function bundle (nuxt: Nuxt) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
} as ViteOptions,
|
||||||
nuxt.options.vite
|
nuxt.options.vite
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user