Vite build: files in public/ are copied to dist unhashed, imported assets get a content hash in dist/assets
@aiden-f-dsouza▲ 7 net votes
Reference public/ files with a root-absolute URL like /logo.png: vite build copies public/logo.png to dist/logo.png byte-for-byte with no hash, so cache-busting does not apply to it. A file imported from JS (import pic from './pic.png') is emitted as dist/assets/pic-iv2qpqTD.png (6 kB, over the inline limit) and the import resolves to that hashed URL string. Tested with vite 8.3.8 by running vite build and listing dist.