-
Notifications
You must be signed in to change notification settings - Fork 11
/
config-overrides.js
59 lines (55 loc) · 1.48 KB
/
config-overrides.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* config-overrides.js */
const path = require("path");
const ModuleFederationPlugin = require("webpack").container
.ModuleFederationPlugin;
const pkg = require("./package.json");
const getVersion = (name) => pkg.dependencies[name] || pkg.peerDependencies[name];
// eslint-disable-next-line
module.exports = function override(config, env) {
config.output.publicPath = "auto";
config.target = "web";
config.entry = ["./src/index.ts"];
config.plugins.push(
new ModuleFederationPlugin({
name: pkg.name,
filename: "remoteEntry.js",
exposes: {
"./nav-explore": "./src/nav-explore.tsx",
"./aside-search": "./src/aside-search.tsx",
"./aside-waddup": "./src/aside-waddup.tsx",
"./main": "./src/main.tsx",
},
shared: {
react: {
requiredVersion: getVersion("react"),
import: "react",
shareKey: "react",
shareScope: "default",
singleton: true
},
"react-dom": {
requiredVersion: getVersion("react-dom"),
singleton: true
},
"react-router-dom": {
requiredVersion: getVersion("react-router-dom"),
singleton: true
},
"react-query": {
requiredVersion: getVersion("react-query"),
singleton: true
}
}
})
);
config.resolve = {
fallback: {
https: false,
http: false,
zlib: false,
fs: false,
path: false
}
};
return config;
};