forked from module-federation/module-federation-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
39 lines (38 loc) · 855 Bytes
/
webpack.config.ts
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
import { container } from 'webpack';
const deps = require('./package.json').dependencies;
module.exports = {
output: {
publicPath: 'http://localhost:4201/',
uniqueName: 'mdmfprofile',
scriptType: 'text/javascript',
},
optimization: {
runtimeChunk: false,
},
devServer: {
port: 4201,
headers: {
'Access-Control-Allow-Origin': '*',
},
hot: true,
},
plugins: [
new container.ModuleFederationPlugin({
name: 'profile',
filename: 'remoteEntry.js',
remotes: {
list_user: `list_user@http://localhost:3002/remoteEntry.js`,
},
shared: {
react: {
singleton: true,
requiredVersion: deps.react,
},
'react-dom/client': {
singleton: true,
requiredVersion: deps['react-dom'],
},
},
}),
],
};