Skip to content

Commit

Permalink
fix(enhanced): remove resolve replacements (#3236)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy authored Nov 17, 2024
1 parent 4c9f725 commit 5613265
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-baboons-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/enhanced': patch
---

remove module resolve path replacements
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,6 @@ class FederationRuntimePlugin {
);
}

if (isHoisted) {
runtimePath = runtimePath.replace('.cjs.js', '.esm.mjs');
}

const alias: any = compiler.options.resolve.alias || {};
alias['@module-federation/runtime$'] =
alias['@module-federation/runtime$'] || runtimePath;
Expand Down Expand Up @@ -437,11 +433,6 @@ class FederationRuntimePlugin {
}

if (this.options?.experiments?.federationRuntime === 'hoisted') {
this.bundlerRuntimePath = this.bundlerRuntimePath.replace(
'.cjs.js',
'.esm.mjs',
);

new EmbedFederationRuntimePlugin().apply(compiler);

new HoistContainerReferences().apply(compiler);
Expand All @@ -450,7 +441,7 @@ class FederationRuntimePlugin {
/@module-federation\/runtime/,
(resolveData) => {
if (/webpack-bundler-runtime/.test(resolveData.contextInfo.issuer)) {
resolveData.request = RuntimePath.replace('cjs.js', 'esm.mjs');
resolveData.request = RuntimePath;

if (resolveData.createData) {
resolveData.createData.request = resolveData.request;
Expand Down

0 comments on commit 5613265

Please sign in to comment.