-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathnext.config.js
More file actions
44 lines (40 loc) · 1.01 KB
/
next.config.js
File metadata and controls
44 lines (40 loc) · 1.01 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
const { withNx } = require('@nx/next/plugins/with-nx');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
const { dependencies } = require('../../package.json');
/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
svgr: false,
},
/**
*
* @param {import('webpack').Configuration} config
* @returns {import('webpack').Configuration}
*/
webpack(config) {
config.plugins.push(
new NextFederationPlugin({
name: 'button',
filename: 'static/chunks/remoteEntry.js',
remotes: {},
extraOptions: {
automaticAsyncBoundary: true,
},
exposes: {
'./Button': './components/Button/index.tsx',
},
shared: {
'styled-components': {
eager: true,
singleton: true,
requiredVersion: dependencies['styled-components'],
},
},
}),
);
return config;
},
};
module.exports = withNx(nextConfig);