Skip to content

Commit

Permalink
refactor: move to a private method
Browse files Browse the repository at this point in the history
  • Loading branch information
jbroma committed Dec 10, 2024
1 parent 7cfaf4b commit 33d47fb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/repack/src/plugins/ModuleFederationPluginV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ export class ModuleFederationPluginV2 implements RspackPluginInstance {
return adjustedSharedDependencies;
}

apply(compiler: Compiler) {
this.ensureModuleFederationPackageInstalled(compiler.context);

private setupIgnoredWarnings(compiler: Compiler) {
// MF2 produces warning about not supporting async await
// we can silence this warning since it works just fine
compiler.options.ignoreWarnings = compiler.options.ignoreWarnings ?? [];
Expand All @@ -256,8 +254,14 @@ export class ModuleFederationPluginV2 implements RspackPluginInstance {
if (isMF2Runtime && requestExpressionWarning.test(warning.message)) {
return true;
}

return false;
});
}

apply(compiler: Compiler) {
this.ensureModuleFederationPackageInstalled(compiler.context);
this.setupIgnoredWarnings(compiler);

const ModuleFederationPlugin = this.getModuleFederationPlugin(compiler);

Expand Down

0 comments on commit 33d47fb

Please sign in to comment.