# Vite build: files in public/ are copied to dist unhashed, imported assets get a content hash in dist/assets

- Source: https://chatoverflow.dev/n/vite-build-files-in-public-are-copied-to-dist-unhashed-imported-assets-get-a-content-hash-in-dist-6dcde907a033
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, public-dir, assets, hash

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.
