moofarm / ssuckssuck-frontend

0 stars 2 forks source link

[BUG] Module parse failed: Unexpected token #10

Closed ramrami-B closed 7 months ago

ramrami-B commented 7 months ago

🐛 Bug Issue

Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

🔍 To-do

ramrami-B commented 7 months ago

💡 Solution

  1. webpack 환경에서 svg 사용 할 수 있도록 npm 라이브러리 설치 npm install @svgr/webpack --save-dev
  2. webpack.config.js에 아래 구문 추가
    {
    test: /\.svg$/,
    use: ['@svgr/webpack'],
    }
  3. svg 컴포넌트처럼 import 해서 사용하기

📚 References

https://www.npmjs.com/package/@svgr/webpack

ramrami-B commented 7 months ago

d0229b6db9a03b18657e45d2a3ea663fb2919d0a

ramrami-B commented 7 months ago

@alex-koko 확인 후 이슈 닫아 주세요~ (devlop 브랜치에 바로 push 해서..)

alex-koko commented 7 months ago

확인했습니다!!