-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.mjs
More file actions
104 lines (100 loc) · 2.79 KB
/
Copy pathnext.config.mjs
File metadata and controls
104 lines (100 loc) · 2.79 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { withSentryConfig } from '@sentry/nextjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
compress: false,
webpack(config, { isServer }) {
if (!isServer) {
config.resolve.alias = {
...config.resolve.alias,
jsdom: false,
};
}
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [
{
loader: '@svgr/webpack',
options: {
svgo: true,
svgoConfig: {
plugins: [],
},
},
},
],
});
config.module.rules.push({
test: /\.(png|jpe?g|gif|webp|avif)$/i,
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: 8 * 1024,
},
},
});
return config;
},
experimental: {
reactCompiler: true,
workerThreads: false,
},
async headers() {
return [
{
// 브라우저 프로파일링(Sentry browserProfilingIntegration)은 이 헤더가 없으면
// 오류 없이 조용히 아무 데이터도 수집하지 않는다.
source: '/:path*',
headers: [{ key: 'Document-Policy', value: 'js-profiling' }],
},
];
},
images: {
// 이 값이 최적화 결과의 디스크 캐시 수명과 응답 Cache-Control 을 함께 결정한다.
// 기본값 60초로 두면 브라우저·nginx 캐시까지 60초로 묶인다.
// 업로드 URL 이 UUID 기반이라 불변이므로 길게 잡는다. URL 재사용 운영을 한다면 줄일 것.
minimumCacheTTL: 2678400, // 31일
remotePatterns: [
{
protocol: 'https',
hostname: 'stage-static.koreatech.in',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'static.koreatech.in',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'bcsdlab.com',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'placehold.co',
pathname: '/**',
},
],
},
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG || 'bcsd',
project: process.env.SENTRY_PROJECT || 'koin-prod',
release: {
name: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
// 릴리스에 포함된 커밋을 연결한다. 이슈마다 원인 커밋(Suspect Commits)이 표시되고
// 어느 릴리스에서 유입이 시작됐는지 추적할 수 있다.
// CI 밖(로컬 빌드 등)에서는 커밋 정보가 없어 실패할 수 있으므로 ignoreMissing 을 켠다.
setCommits: { auto: true, ignoreMissing: true },
},
silent: !process.env.CI,
widenClientFileUpload: true,
tunnelRoute: '/monitoring',
bundleSizeOptimizations: {
excludeDebugStatements: true,
},
sourcemaps: {
deleteSourcemapsAfterUpload: true,
},
});