Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 17e24d5

Browse files
committed
merge remotes
1 parent d3f6835 commit 17e24d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/universal-module-federation-plugin/src/UniversalModuleFederationPlugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class UniversalModuleFederationPlugin {
2424
this.webpackVersion = null
2525
}
2626
apply(compiler) {
27+
compiler.__umfplugin__allRemotes = Object.assign(compiler.__umfplugin__allRemotes || {}, this.options.remotes)
2728
this.webpackVersion = getWebpackVersion(compiler)
2829
this.mfOptions = this.getMfInstance(compiler.options.plugins)._options
29-
this.containerRemoteKeyMap = this.getContainerRemoteKeyMap(this.mfOptions.remotes)
30-
this.remoteMap = this.getRemoteMap(this.mfOptions.remotes)
30+
this.containerRemoteKeyMap = this.getContainerRemoteKeyMap(compiler.__umfplugin__allRemotes)
31+
this.remoteMap = this.getRemoteMap(compiler.__umfplugin__allRemotes)
3132
this.appName = this.mfOptions.name
3233
this.options.runtimeInject = this.formatRuntimeInject(this.options.runtimeInject)
3334
let injectCode = `
@@ -149,7 +150,6 @@ class UniversalModuleFederationPlugin {
149150
return map
150151
}
151152

152-
// TODO: merge remotes
153153
getRemoteMap(remotes = {}) {
154154
const map = {}
155155
Object.keys(remotes).forEach(key => {

0 commit comments

Comments
 (0)