forked from Team-HAGOJAEBI/diground-fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
79 lines (74 loc) · 2.13 KB
/
Copy pathnext.config.ts
File metadata and controls
79 lines (74 loc) · 2.13 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
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// 외부 이미지 도메인 허용 설정
images: {
remotePatterns: [
{
protocol: "https",
hostname: "cdnimg.melon.co.kr",
port: "", // 사용하지 않으면 빈 문자열
pathname: "/**", // 서브 경로 전체 허용 (필터링이 필요하면 세부 경로로 좁혀도 됨)
},
{
protocol: "http",
hostname: "k.kakaocdn.net",
port: "",
pathname: "/**", // 서브 경로 전체 허용 (필터링이 필요하면 세부 경로로 좁혀도 됨)
},
{
protocol: "http",
hostname: "img1.kakaocdn.net",
port: "", // 사용하지 않으면 빈 문자열
pathname: "/**", // 서브 경로 전체 허용 (필터링이 필요하면 세부 경로로 좁혀도 됨)
},
{
protocol: "https",
hostname: "i.ytimg.com",
port: "", // 사용하지 않으면 빈 문자열
pathname: "/**", // 서브 경로 전체 허용 (필터링이 필요하면 세부 경로로 좁혀도 됨)
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
port: "",
pathname: "/**", // Google 프로필 이미지
},
],
domains: ["image.bugsm.co.kr"],
},
turbopack: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
}, // webpack 설정
webpack: (config) => {
const fileLoaderRule = config.module.rules.find((rule: any) => 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/] },
use: [
{
loader: "@svgr/webpack",
options: {
typescript: true,
ext: "tsx",
},
},
],
}
);
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
};
export default nextConfig;