-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote.webpack.config.js
38 lines (36 loc) · 1.06 KB
/
remote.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
38
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
const webpackMerge = require('webpack-merge');
module.exports = (config, options, targetOptions) => {
const mfConfig = {
output: {
uniqueName: "host"
},
optimization: {
// Only need to bypass a temporary bug
// Taken from https://github.com/manfredsteyer/webpack_5_module_federation_and_angular_cli/blob/main/projects/mfe1/webpack.extra.js
runtimeChunk: false
},
plugins: [
new ModuleFederationPlugin({
name: 'remoteAppExample',
library: { type: 'var', name: 'remoteAppExample' },
filename: 'remoteEntry.js',
exposes: {
'./Component': './projects/remote-app/src/app/app.component.ts'
},
shared: {
'@angular/core': {
eager: true,
},
'@angular/common': {
eager: true,
},
'@angular/router': {
eager: true,
}
}
}),
],
};
return webpackMerge.smart(config, mfConfig);
};