fix(vite): remove aliases from inline list (#1520)

This commit is contained in:
Daniel Roe 2021-10-27 15:41:52 +01:00 committed by GitHub
parent 07ad7254e6
commit f78ec933fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,19 +25,10 @@ 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.
...aliasKeys,
...ExternalsDefaults.inline,
...ssrConfig.noExternal
],