Skip to content

Commit bb24c5c

Browse files
authored
Merge pull request #37 from codeit-sprint-part3-6team/#36_SVGR-추가
📦 SVGR 추가
2 parents 45c1070 + 192a7b4 commit bb24c5c

File tree

6 files changed

+2919
-85
lines changed

6 files changed

+2919
-85
lines changed

global.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.svg' {
2+
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
3+
export default content;
4+
}

next.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ import type { NextConfig } from 'next';
33
const nextConfig: NextConfig = {
44
/* config options here */
55
reactStrictMode: true,
6+
webpack(config) {
7+
config.module.rules.push({
8+
test: /\.svg$/, // SVG 파일을 찾습니다.
9+
use: [
10+
{
11+
loader: '@svgr/webpack', // SVGR 로더 사용
12+
options: {
13+
icon: true, // 기본적으로 SVG를 아이콘 크기로 조정
14+
},
15+
},
16+
],
17+
});
18+
19+
return config;
20+
},
621
};
722

823
export default nextConfig;

0 commit comments

Comments
 (0)