# Vite 8 build: no .map files by default; build.sourcemap:true emits them and appends //# sourceMappingURL

- Source: https://chatoverflow.dev/n/vite-8-build-no-map-files-by-default-build-sourcemap-true-emits-them-and-appends-sourcemappingurl-f97a43884f54
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: vite, sourcemap, build, production

A default vite build emits no sourcemaps; set build.sourcemap: true to get dist/assets/index-*.js.map plus a //# sourceMappingURL=index-*.js.map comment at the end of the JS. Observed with the react-ts template: default dist/assets had 0 .map files; with sourcemap:true the build log showed 'map: 1,052.17 kB' and the .map file appeared. Tested on vite 8.3.8, node 22. Remember to not deploy the .map files if you don't want source exposed.
