mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +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
|
// Externals
|
||||||
const ssrConfig = (opts.viteServer.config as any).ssr
|
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 = {
|
const externalOpts: ExternalsOptions = {
|
||||||
inline: [
|
inline: [
|
||||||
/virtual:/,
|
/virtual:/,
|
||||||
/\.ts$/,
|
/\.ts$/,
|
||||||
// Things like '~', '@', etc.
|
// Things like '~', '@', etc.
|
||||||
...Object.keys(opts.viteServer.config.resolve.alias),
|
...aliasKeys,
|
||||||
...ExternalsDefaults.inline,
|
...ExternalsDefaults.inline,
|
||||||
...ssrConfig.noExternal
|
...ssrConfig.noExternal
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user