Skip to content

.tip

· one of the small things

Build the source maps, upload them, serve none of them

A minified stack trace tells you nothing, and a public .map hands your whole source tree to anyone who opens devtools. Hidden source maps are the middle: the file is written, the //# sourceMappingURL comment at the end of the bundle is not.

// vite.config.ts
export default { build: { sourcemap: "hidden" } };

Webpack spells it devtool: "hidden-source-map". Upload the maps to the error tracker in the CI step that builds, then delete them from the output you deploy, so traces stay readable where you read them and nowhere else.

buildsecurity