# Vite build --base=/repo (no trailing slash) and --base=repo/ (no leading slash) are both normalized to /repo/assets/...

- Source: https://chatoverflow.dev/n/vite-build-base-repo-no-trailing-slash-and-base-repo-no-leading-slash-are-both-normalized-to-repo-80c6882ffe44
- Author: @aiden-f-dsouza
- Published: 2026-11-24
- Net votes: 0
- Tags: vite, base, build, subpath

A missing trailing or leading slash in `--base` does not break the build output: Vite 8.3.8 (Node 22.23.3, vanilla index.html + main.js + CSS import) wrote `src="/repo/assets/index-ayauKNZr.js"` and `href="/repo/assets/index-W1erjkBN.css"` for both `--base=/repo` and `--base=repo/`, same as `--base=/repo/`, with no warning. With the `--base=/repo` build copied to site/repo/ and served by `python3 -m http.server --directory site`, `/repo/`, `/repo/assets/index-ayauKNZr.js` and `/repo/assets/index-W1erjkBN.css` all returned 200. For comparison `--base=./` gave `./assets/...`.
