-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
51 lines (45 loc) · 1.28 KB
/
next.config.mjs
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
// next.config.mjs
import bundleAnalyzer from '@next/bundle-analyzer';
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
const withVanillaExtract = createVanillaExtractPlugin();
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
remotePatterns: [
// {
// protocol: 'https',
// hostname: 's3.ap-northeast-2.amazonaws.com',
// port: '',
// pathname: '/omocha.storages/**',
// },
{
protocol: 'https',
hostname: 'd3dwom6xle09jw.cloudfront.net',
port: '',
pathname: '/auction/upload/images/**',
},
],
domains: ['imgstatic.10x10.co.kr', 'via.placeholder.com'], // 허용할 도메인 추가
},
webpack: config => {
// SVG 파일 처리 설정
config.module.rules.push({
test: /\.svg$/i,
use: ['@svgr/webpack'],
});
return config;
},
};
// console.error와 console.warn은 유지되고, 나머지 console 호출은 제거
if (process.env.NEXT_PUBLIC_NODE_ENV === 'prod') {
nextConfig.compiler = {
removeConsole: {
exclude: ['error', 'warn'],
},
};
}
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
export default withBundleAnalyzer(withVanillaExtract(nextConfig));