mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(vite): dev-bundler externality (#1507)
This commit is contained in:
parent
0326a31990
commit
00e25fa8e8
@ -25,12 +25,19 @@ function isExternal (opts: TransformOptions, id: string) {
|
||||
// Externals
|
||||
const ssrConfig = (opts.viteServer.config as any).ssr
|
||||
|
||||
// Vite's alias have two possible formats
|
||||
// https://vitejs.dev/config/#resolve-alias
|
||||
const alias = opts.viteServer.config.resolve.alias || {}
|
||||
const aliasKeys = Array.isArray(alias)
|
||||
? alias.map(i => i.find).filter(Boolean)
|
||||
: Object.keys(alias)
|
||||
|
||||
const externalOpts: ExternalsOptions = {
|
||||
inline: [
|
||||
/virtual:/,
|
||||
/\.ts$/,
|
||||
// Things like '~', '@', etc.
|
||||
...Object.keys(opts.viteServer.config.resolve.alias),
|
||||
...aliasKeys,
|
||||
...ExternalsDefaults.inline,
|
||||
...ssrConfig.noExternal
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user