crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.71k stars 181 forks source link

@crxjs/vite-plugin doesn't work with the vite-plugin-svg-icons in dev mode #654

Open Electr1Xx opened 1 year ago

Electr1Xx commented 1 year ago

Build tool

Vite

Where do you see the problem?

Describe the bug

Currently the @crxjs/vite-plugin doesn't work with the vite-plugin-svg-icons in dev mode, but for build for production, all works.

Reproduction

Using the following vite.config.js

image image

add svg icons into src/popup/assets/icons and import

image

in main vue file here https://github.com/vbenjs/vite-plugin-svg-icons you can check how setup plugin and add icons and running yarn vite I don't see a sprite map in index.html and icons in the extension, but if I run yarn vite build, all works fine

Logs

No response

System Info

System:
    OS: macOS 11.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 1.18 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Brave Browser: 110.1.48.164
    Chrome: 110.0.5481.100
    Firefox: 109.0.1
    Safari: 16.1

Severity

annoyance

mjangir commented 3 months ago

@Electr1Xx Did you get it working?

Electr1Xx commented 3 months ago

@mjangir No