Skip to content

Commit 019f325

Browse files
committed
svgr typescript 지원
1 parent 7d6a5f5 commit 019f325

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

services/one-app/next.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const nextConfig = {
88
use: [
99
{
1010
loader: '@svgr/webpack',
11-
options: {},
11+
options: {
12+
svgo: true,
13+
typescript: true,
14+
},
1215
},
1316
],
1417
});

services/one-app/src/globals.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.svg' {
2+
import React from 'react';
3+
const content: React.FC<React.SVGProps<SVGSVGElement>>;
4+
export default content;
5+
}

services/one-app/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
"@/*": ["./src/*"]
2323
}
2424
},
25-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25+
"include": [
26+
"next-env.d.ts",
27+
"**/*.ts",
28+
"**/*.tsx",
29+
"./src/globals.d.ts",
30+
".next/types/**/*.ts"
31+
],
2632
"exclude": ["node_modules"]
2733
}

0 commit comments

Comments
 (0)