-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
executable file
·73 lines (67 loc) · 1.63 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/** @type {import('next').NextConfig} */
const withPlugins = require('next-compose-plugins');
const withLess = require('next-with-less');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
/**
* 차후 pwa도 swc로 마이그레이션 예정
*/
const nextConfig = {
reactStrictMode: true,
compiler: {
styledComponents: {
ssr: true,
displayName: true,
fileName: true,
pure: true,
},
},
images: {
domains: [
'www.forest.go.kr',
'gogo-s3-bucket.s3.ap-northeast-2.amazonaws.com',
'img.youtube.com',
],
},
async rewrites() {
return [
{
source: '/server/:path*',
destination: 'http://3.38.224.88:8080/:path*',
},
];
},
webpack(config, { dev, isServer }) {
const prod = process.env.NODE_ENV === 'production';
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
});
if (!dev) config.devtool = isServer ? false : 'nosources-source-map';
return {
...config,
mode: prod ? 'production' : 'development',
};
},
};
module.exports = async (phase, { defaultConfig }) =>
withPlugins(
[
withBundleAnalyzer,
[
withLess,
{
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': '#009D68' },
lessVarsFilePath: './assets/css/variables.less',
lessVarsFilePathAppendToEndOfContent: false,
},
},
},
],
],
nextConfig
)(phase, { ...defaultConfig, ...nextConfig });