Skip to content

Inlining SVG icons referenced in CSS (but stored in ./public/icons/*.svg) #19495

Answered by hi-ogawa
vadimkantorov asked this question in Q&A
Discussion options

You must be logged in to vote

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 of public to trigger Vite's asset hashing/inlining behavior https://stackblitz.com/edit/vitejs-vite-r3w49z8f?file=src%2Fstyle.css

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vadimkantorov
Comment options

@hi-ogawa
Comment options

@vadimkantorov
Comment options

Answer selected by vadimkantorov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants