Skip to content

Commit

Permalink
fix(enhanced): failed to load federation runtime, loading module at b…
Browse files Browse the repository at this point in the history
…uild time
  • Loading branch information
lnlfps committed Nov 18, 2024
1 parent 597007d commit 0953476
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ class FederationRuntimeModule extends RuntimeModule {
);
const { chunkHasJs } = jsModulePlugin;
if (this.runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers)) {
const conditionMap = this.compilation.chunkGraph.getChunkConditionMap(
this.chunk,
chunkHasJs,
);
const hasJsMatcher = compileBooleanMatcher(conditionMap);
if (typeof hasJsMatcher === 'boolean') {
matcher = hasJsMatcher;
} else {
matcher = hasJsMatcher('chunkId');
if (this.compilation.chunkGraph) {
const conditionMap =
this.compilation.chunkGraph?.getChunkConditionMap(
this.chunk,
chunkHasJs,
);
const hasJsMatcher = compileBooleanMatcher(conditionMap);
if (typeof hasJsMatcher === 'boolean') {
matcher = hasJsMatcher;
} else {
matcher = hasJsMatcher('chunkId');
}
}
const outputName = this.compilation.getPath(
jsModulePlugin.getChunkFilenameTemplate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ class FederationRuntimePlugin {
this.constructor.name,
(compilation: Compilation) => {
const handler = (chunk: Chunk, runtimeRequirements: Set<string>) => {
if (chunk.id === 'build time chunk') {
return;
}
if (runtimeRequirements.has(federationGlobal)) return;
runtimeRequirements.add(federationGlobal);
runtimeRequirements.add(RuntimeGlobals.interceptModuleExecution);
Expand Down

0 comments on commit 0953476

Please sign in to comment.