-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
57 lines (55 loc) · 1.55 KB
/
next.config.js
File metadata and controls
57 lines (55 loc) · 1.55 KB
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
const {
PHASE_DEVELOPMENT_SERVER,
PHASE_PRODUCTION_BUILD,
} = require("next/constants");
// const devConfig = require("./webpack.dev");
// const prdConfig = require("./webpack.prod");
const packageJson = require("./package.json");
const deps = packageJson.dependencies;
module.exports = {
webpack: (config, { webpack }) => {
const { ModuleFederationPlugin } = webpack.container;
config.plugins.push(
new ModuleFederationPlugin({
name: "task_tracker_components",
library: {
type: config.output.libraryTarget,
name: "task_tracker_components",
},
filename: "static/runtime/remoteEntry.js",
exposes: {
"./Button": "./src/components/Button",
"./Card": "./src/components/Card",
"./CardContent": "./src/components/CardContent",
"./CardHeader": "./src/components/CardHeader",
},
remotes: {},
shared: {
react: {
singleton: true,
requiredVersion: deps.react,
},
"react-dom": {
singleton: true,
requiredVersion: deps["react-dom"],
},
"@material-ui/core": {
singleton: true,
},
"@material-ui/icons": {
singleton: true,
},
"@material-ui/lab": {
singleton: true,
},
"styled-components": {
singleton: true,
requiredVersion: deps["styled-components"],
},
},
shared: [],
})
);
return config;
},
};