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

36 lines
733 B
JavaScript

const ModuleFederationPlugin = require("../../../../lib/container/ModuleFederationPlugin");
function createConfig() {
return {
output: {
libraryTarget: "system"
},
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"],
remotes: {
abc: "ABC",
def: "DEF",
self: "./container2.js",
other: "./container.js"
}
})
]
};
}
module.exports = createConfig();