Skip to content

Commit

Permalink
fix(vite): don't alias pkg name to avoid vitesse build bug
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Aug 23, 2022
1 parent 56c88e1 commit 6873fe1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/vite/src/plugins/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ export const AliasRuntimePlugin = () => createUnplugin<AliasPluginOptions>((user
}
},
async webpack(compiler) {
const { pkg, provider, runtime } = await fetchPaths()
const { provider, runtime } = await fetchPaths()

compiler.options.resolve.alias = {
...compiler.options.resolve.alias || {},
[PkgName]: pkg,
[AliasProvider]: provider,
[AliasRuntime]: runtime,
}
Expand All @@ -108,8 +107,6 @@ export const AliasRuntimePlugin = () => createUnplugin<AliasPluginOptions>((user
config.resolve = config.resolve || {}
config.resolve.alias = config.resolve.alias || {}
// @ts-expect-error untyped
config.resolve.alias[PkgName] = pkg
// @ts-expect-error untyped
config.resolve.alias[AliasProvider] = provider
// @ts-expect-error untyped
config.resolve.alias[AliasRuntime] = runtime
Expand Down

0 comments on commit 6873fe1

Please sign in to comment.