generated from TOKTOKHAN-DEV/next-init-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
48 lines (47 loc) · 1.12 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
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({
// images: {
// domains: ['example.com'], // remote 이미지를 next image 로 랜더링하고싶다면 도메인을 설정해주세요
// },
swcMinify: true,
poweredByHeader: false,
eslint: {
ignoreDuringBuilds: true,
},
reactStrictMode: true,
compiler: {
removeConsole:
process.env.NODE_ENV === 'production' ? { exclude: ['error'] } : false,
},
modularizeImports: {
'lodash-es': {
transform: 'lodash-es/{{member}}',
preventFullImport: true,
},
},
webpack: (config, { isServer }) => {
if (isServer) {
require('./src/scripts/generate-sitemap-json');
}
return config;
},
async rewrites() {
return [
{
source: '/sitemap.xml',
destination: '/api/sitemap',
},
];
},
images: {
remotePatterns: [
{
hostname: '*.s3.*.amazonaws.com',
},
],
},
});