-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathnext.config.js
34 lines (33 loc) · 941 Bytes
/
next.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
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const deps = require('./package.json').dependencies;
module.exports = {
webpack(config, options) {
if (!options.isServer) {
config.plugins.push(
new NextFederationPlugin({
name: 'next-host',
filename: 'static/chunks/remoteEntry.js',
remotes: {
reactRemote: 'reactRemote@http://localhost:3002/remoteEntry.js',
},
exposes: {},
shared: {
'i18next-shared-lib/': {
// BEWARE THE TRAILING "/" !!
singleton: true,
},
i18next: {
singleton: true,
requiredVersion: deps.i18next,
},
'react-i18next': {
singleton: true,
requiredVersion: deps['react-i18next'],
},
},
}),
);
}
return config;
},
};