forked from DustinBrett/daedalOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
53 lines (46 loc) · 1.16 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @ts-check
const isProduction = process.env.NODE_ENV === "production";
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: isProduction,
});
const webpack = require("webpack");
/**
* @type {import("next").NextConfig}
* */
const nextConfig = {
compiler: {
reactRemoveProperties: isProduction,
removeConsole: isProduction,
styledComponents: true,
},
devIndicators: {
buildActivity: false,
},
experimental: {
disablePostcssPresetEnv: true,
reactRoot: true,
swcFileReading: true,
},
optimizeFonts: false,
reactStrictMode: true,
swcMinify: !isProduction,
webpack: (config) => {
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
const mod = resource.request.replace(/^node:/, "");
switch (mod) {
case "buffer":
resource.request = "buffer";
break;
case "stream":
resource.request = "readable-stream";
break;
default:
throw new Error(`Not found ${mod}`);
}
})
);
return config;
},
};
module.exports = withBundleAnalyzer(nextConfig);