typescript svg

Frontend/Typescript

[Vite + TS] Vite에서 svg 파일을 못 읽을 때(@svgr/rollup 사용)

지금까지는 Webpack(Create-react-app) 환경에서 TypeScript를 실행했었기에 custom.d.ts(혹은 global.d.ts)에서 declare module "*.svg" { import React = require("react"); export const ReactComponent: React.FC; const src: string; export default src; } 위와 같이 작성하면 svg 파일이 잘 실행이 되었었다. 그런데 이번에 새로 프로젝트를 할 때 아래와 같이 svg 파일을 사용하려고 했는데, import { ReactComponent as ~~~Icon} from '../../ ........생략' 위와 같이 ReactComponent로 불러올려고 했는데 svg..

퀵차분
'typescript svg' 태그의 글 목록