Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-months-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/enhanced': patch
---

fix(enhanced): use default runtime export
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ const BundlerRuntimePath = require.resolve(
paths: [RuntimeToolsPath],
},
);
const RuntimePath = require.resolve('@module-federation/runtime', {
paths: [RuntimeToolsPath],
});
const EmbeddedRuntimePath = require.resolve(
'@module-federation/runtime/embedded',
const RuntimePath = require.resolve(
'@module-federation/runtime/dist/index.esm.mjs',
{
paths: [RuntimeToolsPath],
},
Expand Down Expand Up @@ -331,13 +328,16 @@ class FederationRuntimePlugin {
}

setRuntimeAlias(compiler: Compiler) {
const { experiments, implementation } = this.options || {};
let runtimePath = EmbeddedRuntimePath;
const { implementation } = this.options || {};
let runtimePath = RuntimePath;

if (implementation) {
runtimePath = require.resolve(`@module-federation/runtime/embedded`, {
paths: [implementation],
});
runtimePath = require.resolve(
`@module-federation/runtime/dist/index.esm.mjs`,
Comment thread
2heal1 marked this conversation as resolved.
Outdated
{
paths: [implementation],
},
);
}

const alias: any = compiler.options.resolve.alias || {};
Expand Down