-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
43 lines (36 loc) · 1.14 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
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-var-requires,no-undef
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
// eslint-disable-next-line no-undef
const isProduction = process.env.NODE_ENV === "production";
// eslint-disable-next-line @typescript-eslint/no-var-requires,no-undef
const withBundleAnalyzer = require("@next/bundle-analyzer")({
// eslint-disable-next-line no-undef
enabled: process.env.ANALYZE === "true",
});
// eslint-disable-next-line @typescript-eslint/no-var-requires,no-undef
const { i18n } = require("./next-i18next.config");
const nextConfig = {
reactStrictMode: false,
swcMinify: true,
i18n,
images: {
domains: ["18.134.13.108"],
},
/**
* Webpack
*/
webpack: (config) => {
if (isProduction) {
config.optimization.minimizer = [];
config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}));
}
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
};
// eslint-disable-next-line no-undef
module.exports = withBundleAnalyzer(nextConfig);