webpack/test/configCases/container/module-federation/webpack.config.js

36 lines
733 B
JavaScript
Raw Normal View History

2020-04-04 07:13:16 +08:00
const ModuleFederationPlugin = require("../../../../lib/container/ModuleFederationPlugin");
2020-04-05 06:26:02 +08:00
function createConfig() {
2020-04-04 12:31:52 +08:00
return {
2020-04-05 06:26:02 +08:00
output: {
libraryTarget: "system"
},
2020-04-04 12:31:52 +08:00
plugins: [
new ModuleFederationPlugin({
name: "container",
filename: "container.js",
exposes: ["./other", "./self", "./dep"],
remotes: {
abc: "ABC",
def: "DEF",
self: "./container.js",
other: "./container2.js"
}
}),
new ModuleFederationPlugin({
name: "container2",
filename: "container2.js",
exposes: ["./other", "./self", "./dep"],
2020-04-04 12:31:52 +08:00
remotes: {
abc: "ABC",
def: "DEF",
self: "./container2.js",
other: "./container.js"
2020-04-04 12:31:52 +08:00
}
})
]
};
}
2020-04-05 06:26:02 +08:00
module.exports = createConfig();