A source map is a file that links an app's compressed JavaScript back to the code as it was written. Browsers and error trackers use it to show an error at the right line in the right file, instead of at column 48,213 of one long line.
How it works
Before an app is published, a build tool such as Vite bundles its files together, removes spaces and comments and shortens names. The result loads fast and is hard to read. If source maps are switched on, the build tool also writes a .map file next to each bundle and adds a last line to the bundle that says where it is:
//# sourceMappingURL=index-4f2a91.js.map
When the developer tools are open, the browser follows that line, fetches the map and shows the original files. The map usually contains the full original code in a field called sourcesContent, with file names and comments.
Why it matters on a live site
The compressed JavaScript is public anyway, and a patient reader can work out what it does. A source map removes the need for patience. It shows how the app is put together, which tables and functions it calls, how it decides what a user may do, and what the developer wrote in comments. None of that is a weakness in itself, but it makes weaknesses quicker to find.
That makes a source map on a production site a small finding rather than a serious one. It is still worth removing, because it gives away more than the app needs to.
How to check and switch it off
Open the app's main JavaScript file and look at its last line. If it names a .map file, open that address. If the answer is JSON that starts with a curly brace and contains "sources", the original code is published.
In Vite the setting is build.sourcemap. It is off by default, so a map on a live site usually means it was switched on while someone chased a bug and never switched off again. If you want maps for error tracking, upload them to the tracking service and keep them off the public site. The setting "hidden" writes the maps without the line that points to them, which is a middle ground: the files exist, but a browser is not told where.
Source maps are one of three kinds of file that should not be on a live site, together with the .env file and the version history.