From 88dc11f575b0052aa37d692630cc3f1a6d9f0b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Roma=C5=84czyk?= Date: Wed, 11 Oct 2023 17:13:38 +0200 Subject: [PATCH] fix(repack): fix webpack's ModuleFederationPlugin configuration (#444) * fix(repack): pass options to webpack ModuleFederationPlugin explictly * chore: add changeset --- .changeset/honest-coins-ring.md | 5 +++++ .../repack/src/webpack/plugins/ModuleFederationPlugin.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/honest-coins-ring.md diff --git a/.changeset/honest-coins-ring.md b/.changeset/honest-coins-ring.md new file mode 100644 index 000000000..cb1aaca9f --- /dev/null +++ b/.changeset/honest-coins-ring.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": patch +--- + +Fix ValidationError in ModuleFederationPlugin caused by reactNativeDeepImports prop diff --git a/packages/repack/src/webpack/plugins/ModuleFederationPlugin.ts b/packages/repack/src/webpack/plugins/ModuleFederationPlugin.ts index d5998e8f6..b2359a683 100644 --- a/packages/repack/src/webpack/plugins/ModuleFederationPlugin.ts +++ b/packages/repack/src/webpack/plugins/ModuleFederationPlugin.ts @@ -244,7 +244,7 @@ export class ModuleFederationPlugin implements WebpackPlugin { ); new container.ModuleFederationPlugin({ - ...this.config, + exposes: this.config.exposes, filename: this.config.filename ?? this.config.exposes ? `${this.config.name}.container.bundle` @@ -256,8 +256,12 @@ export class ModuleFederationPlugin implements WebpackPlugin { ...this.config.library, } : undefined, + name: this.config.name, shared: sharedDependencies, + shareScope: this.config.shareScope, remotes, + remoteType: this.config.remoteType, + runtime: this.config.runtime, }).apply(compiler); } }