farm-fe / farm

Extremely fast Vite-compatible web build tool written in Rust
https://farmfe.org
MIT License
4.52k stars 154 forks source link

[Bug Report]: SVG displays correctly in dev mode but fails to show after build #1499

Open valcosmos opened 2 weeks ago

valcosmos commented 2 weeks ago

Steps to reproduce

1、git clone https://github.com/valcosmos/farm-starter.git 2、pnpm i 3、pnpm dev (In this case, the SVG displays correctly.) 4、pnpm build 5、pnpm preview (But in this case, it fails to display, and the page is blank.)

Reproduce link

https://github.com/valcosmos/farm-starter.git

What is actually happening?

I'm using the vite-plugin-svg-icons plugin to process local SVG icons. However, I've noticed that while the icons display correctly during development (dev mode), they fail to show up after building the project (production build).

when dev: image

when after build: image

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 71.42 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
    pnpm: 9.4.0 - /opt/homebrew/bin/pnpm
    bun: 1.1.17 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 126.0.6478.127
    Chrome Canary: 128.0.6570.0
    Safari: 17.5
valcosmos commented 2 weeks ago

Any response would be greatly appreciated.🥺

wre232114 commented 2 weeks ago

I'll take a look

valcosmos commented 2 weeks ago

I'll take a look

Thank u so much 🙏😊