forked from radix-ui/design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
33 lines (31 loc) · 827 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
module.exports = {
future: {
webpack5: true,
},
webpack: (config, options) => {
//
// Use profiler-enabled React builds
//
config.resolve.alias = {
...config.resolve.alias,
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
};
//
// Disable mangling for easier profiling
// WARNING: This increases bundle size, DO NOT DO THIS in production!
//
const terser = config.optimization.minimizer.find(
(plugin) =>
typeof plugin.options !== 'undefined' && typeof plugin.options.terserOptions !== 'undefined'
);
if (terser) {
terser.options.terserOptions = {
...terser.options.terserOptions,
keep_classnames: true,
keep_fnames: true,
};
}
return config;
},
};