File tree Expand file tree Collapse file tree 1 file changed +41
-9
lines changed Expand file tree Collapse file tree 1 file changed +41
-9
lines changed Original file line number Diff line number Diff line change 1- import { NextConfig } from " next" ;
1+ import type { NextConfig } from ' next' ;
22
33const nextConfig : NextConfig = {
4- turbopack : {
5- rules : {
6- '*.svg' : {
7- loaders : [ '@svgr/webpack' ] ,
8- as : '*.js' ,
4+ // TurboPack 설정
5+ experimental : {
6+ turbo : {
7+ rules : {
8+ '*.svg' : {
9+ loaders : [ '@svgr/webpack' ] ,
10+ as : '*.js' ,
11+ } ,
912 } ,
10- }
13+ } ,
1114 } ,
12- }
15+ // webpack 설정
16+ webpack : ( config ) => {
17+ // @ts -expect-error 타입 에러 무시
18+ const fileLoaderRule = config . module . rules . find ( ( rule ) => rule . test ?. test ?.( '.svg' ) ) ;
1319
14- export default nextConfig ;
20+ config . module . rules . push (
21+ {
22+ ...fileLoaderRule ,
23+ test : / \. s v g $ / i,
24+ resourceQuery : / u r l / ,
25+ } ,
26+ {
27+ test : / \. s v g $ / i,
28+ issuer : fileLoaderRule . issuer ,
29+ resourceQuery : { not : [ ...fileLoaderRule . resourceQuery . not , / u r l / ] } ,
30+ use : [
31+ {
32+ loader : '@svgr/webpack' ,
33+ options : {
34+ typescript : true ,
35+ ext : 'tsx' ,
36+ } ,
37+ } ,
38+ ] ,
39+ }
40+ ) ;
41+ fileLoaderRule . exclude = / \. s v g $ / i;
42+ return config ;
43+ } ,
44+ } ;
45+
46+ export default nextConfig ;
You can’t perform that action at this time.
0 commit comments