-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathwebpack.config.cjs
51 lines (45 loc) · 1.32 KB
/
webpack.config.cjs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
const webpack = require("webpack");
const ModuleFederationPlugin = webpack.container.ModuleFederationPlugin;
const mf = require("@angular-architects/module-federation/webpack");
const path = require("path");
const share = mf.share;
const sharedMappings = new mf.SharedMappings();
sharedMappings.register(
path.join(__dirname, 'tsconfig.json'),
[/* mapped paths to share */]);
module.exports = {
output: {
publicPath: "auto"
},
optimization: {
runtimeChunk: false
},
resolve: {
alias: {
...sharedMappings.getAliases(),
}
},
experiments: {
outputModule: true
},
plugins: [
new ModuleFederationPlugin({
library: { type: "module" },
// For remotes (please adjust)
name: "todoTxtWebUi",
filename: "remoteEntry.js",
exposes: {
'./Module': './src/app/todo-txt-web-ui/todo-txt-web-ui.module.ts',
'./loadRemote': './src/loadRemote.ts'
},
shared: share({
"@angular/core": { requiredVersion: 'auto' },
"@angular/common": { requiredVersion: 'auto' },
"@angular/common/http": { requiredVersion: 'auto' },
"@angular/router": { requiredVersion: 'auto' },
...sharedMappings.getDescriptors()
})
}),
sharedMappings.getPlugin()
],
};