Skip to content

Commit

Permalink
fix: not specify externalsType in rspack mode (#5861)
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy committed Jun 21, 2024
1 parent a7ee8e0 commit ea16092
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-clocks-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-js/plugin-garfish': patch
---

fix: not specify externalsType in rspack mode
12 changes: 0 additions & 12 deletions packages/runtime/plugin-garfish/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,6 @@ export const garfishPlugin = ({
'Access-Control-Allow-Origin': '*',
},
},
rspack: (config: any) => {
config.builtins ??= {};

// eslint-disable-next-line react-hooks/rules-of-hooks
const resolveOptions = useResolvedConfigContext();
if (
resolveOptions?.deploy?.microFrontend &&
!config.externalsType
) {
config.externalsType = 'commonjs';
}
},
bundlerChain: (chain, { env, CHAIN_ID, bundler }) => {
// add comments avoid sourcemap abnormal
if (bundler.BannerPlugin) {
Expand Down

0 comments on commit ea16092

Please sign in to comment.