Inlining SVG icons referenced in CSS (but stored in ./public/icons/*.svg
)
#19495
-
I have Currently, no inlining is happening, How can I make use of the Vite's native SVG inlining feature: #14643 ? My full code is in /~https://github.com/vadimkantorov/moncms Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
public
has a special meaning on Vite and it preserved the exact file path on build https://vite.dev/guide/assets.html#the-public-directory. You can move it outside ofpublic
to trigger Vite's asset hashing/inlining behavior https://stackblitz.com/edit/vitejs-vite-r3w49z8f?file=src%2Fstyle.css