-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
96 lines (89 loc) · 2.01 KB
/
next.config.ts
File metadata and controls
96 lines (89 loc) · 2.01 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
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
reactStrictMode: false,
images: {
remotePatterns: [
{
protocol: 'http',
hostname: '**.kakaocdn.net',
},
{
protocol: 'https',
hostname: '**.kakaocdn.net',
},
{
protocol: 'https',
hostname: 'premierskillsenglish.britishcouncil.org',
},
{
protocol: 'https',
hostname: 'media.gettyimages.com',
},
{
protocol: 'https',
hostname: 'kickon-files-bucket.s3.ap-northeast-2.amazonaws.com',
},
{
protocol: 'https',
hostname: 'kau-kickon-files-bucket.s3.ap-northeast-2.amazonaws.com',
},
{
protocol: 'https',
hostname: 'media.api-sports.io',
},
{
protocol: 'https',
hostname: 'i.ytimg.com',
},
{
protocol: 'https',
hostname: 'ssl.pstatic.net',
},
{
protocol: 'https',
hostname: 'img.coupangstreaming.com',
},
],
dangerouslyAllowSVG: true, // SVG 허용 (보안 주의)
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;", // svg script 공격을 방지하기 위함
},
// async headers() {
// return [
// {
// // public 폴더 내의 모든 .svg 파일에 content type 헤더 추가
// source: '/:path*.svg',
// headers: [
// {
// key: 'Content-Type',
// value: 'image/svg+xml',
// },
// ],
// },
// ];
// },
webpack(config) {
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));
config.module.rules.push(
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/,
},
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // ?url이 없을 때 SVGR 사용
use: ['@svgr/webpack'],
},
);
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
};
if (process.env.NEXT_PUBLIC_NODE_ENV === 'prod') {
nextConfig.compiler = {
removeConsole: true,
};
}
module.exports = nextConfig;