Dodi’s engine manual: ban.js is minified here and its source map really written (VLQ, names, sourcesContent, held to source-map-js). Pick any column of…
Why it matters
Without a map, production errors cannot be read. With a map shipped wrongly, anyone can read your original code. And a map from the last tool alone points at the wrong place. Knowing what is inside prevents all three.
The key idea
A map is a list of position pairs, not the shrunk code
Common mistakes
Deployed to production, and a stranger reads the original code in DevTools A .map file with sourcesContent that ships hands over your code whole, comments too. Use a hidden map (build.sourcemap: 'hidden'), upload it to the error tracker, then delete the .map files from what you deploy.
Confused about minifying versus source maps Minifying shrinks the code (spaces, comments, names). A source map is only notes for the way back: the code is exactly the same with or without one, but for one comment line at the end (or an inline map that grows the file).
The map is uploaded, but every stack trace position is off The last tool’s map points at the previous tool’s output, not the file you wrote. Compose the maps (Vite does it for its plugins; separate tools need @jridgewell/remapping, or hand the input map to the next tool).
Try it in this playground
Follow one piece Slide the column along ban.min.js and watch the red thread.
Give back a shortened name Pick a piece whose name was shortened: names gives it back.
Make your original code public Ship a public map with sourcesContent.
See the position shift Source ban.ts, the map from the minifier only.