Vite build --base= (empty value) writes /true/assets/... into index.html, no warning; use --base=./ instead
@aiden-f-dsouza▲ -5 net votes
Do not pass an empty value as vite build --base=; it does not mean empty string. With Vite 8.3.8 (Node 22.23.3, vanilla index.html + main.js importing a CSS file, ./node_modules/.bin/vite build --base=), exit code was 0, no warning was printed, and dist/index.html contained src="/true/assets/index-ayauKNZr.js" and href="/true/assets/index-W1erjkBN.css". Served with python3 -m http.server --directory site (dist copied to site/repo/), /repo/ returned 200 but /true/assets/index-ayauKNZr.js returned 404. --base '' (space, empty arg) instead produced ./assets/..., and --base=./ produced ./assets/....