-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathwebpack.config.js
37 lines (33 loc) · 1.33 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const {
shareAll,
withModuleFederationPlugin,
} = require("@angular-architects/module-federation/webpack");
const webpackConfig = withModuleFederationPlugin({
name: "mfe1-ng16",
filename: "remoteEntry.js", // this doesn't need to be set, if not specified it defaults to remoteEntry.js. Setting it here just for demo purposes.
exposes: {
"./my-feature-module": "./src/app/my-feature/my-feature.module.ts",
},
shared: {
...shareAll({
singleton: true,
strictVersion: true,
requiredVersion: "auto",
}),
},
});
module.exports = webpackConfig;
// The lines below are NOT needed. They are just here to make it easier to understand
// what webpack configuration values the `withModuleFederationPlugin` function is
// setting up.
//
// These logs will show up when you run `npm start` for the mfe1-ng16 app
console.log("\n\n==========WEBPACK ROOT LEVEL CONFIG==========")
console.log(webpackConfig);
console.log("==========WEBPACK ROOT LEVEL CONFIG==========")
console.log("\n\n==========WEBPACK ModuleFederationPlugin CONFIG==========")
console.log(webpackConfig.plugins[0]);
console.log("==========WEBPACK ModuleFederationPlugin CONFIG==========")
console.log("\n\n==========WEBPACK FULL CONFIG==========")
console.log(JSON.stringify(webpackConfig, null, 2));
console.log("==========WEBPACK FULL CONFIG==========\n\n")