Source maps are critical for web development in today’s JavaScript environment.
In fact, all of our build tools—Rollup, Vite, WebPack, ESBuild—transpile and bundle our JavaScript and support source maps out of the box.
Debugging errors in production with transpiled code is nigh impossible. So our tooling creates source maps.
See What are source maps? by Jecelyn Yeen for all of the details.
Why private source maps?
Private source maps make it harder for an attacker to understand your front-end application. An attacker can easily use public source maps to view the code in its original, un-transpiled state. The same source maps that make debugging easier make attacking your application easier. Check out our unobfuscated source code onhttps://www.highlight.io! It’s readable, public and easy to ingest for developer tools like LaunchDarkly. Our vite bundler generates these source maps with a single flag.

Unobfuscated source code on LaunchDarkly visible in the browser with public source maps.
Why private source maps don’t matter
Guess what! With or without source maps, Chrome Dev Tools makes deconstructing your JavaScript application relatively easy. For instance, You can open up the Network tab and watch each request and response.
Chrome Dev Tools Network tab showing HTTP requests and responses.

Chrome Dev Tools Application tab displaying locally stored site data.
Chat
GPT as de-compiler ChatGPT struggles with long code snippets, so it’s not yet a silver bullet for decompilation.
ChatGPT failing to decompile a long obfuscated code snippet.

ChatGPT successfully decompiling a shorter obfuscated code snippet.
Benefits of public source maps
Debug with Dev Tools
Dev Tools will automatically recognize and apply public source maps to your code. Debugging production issues will be much, much easier, especially if you see errors in your console. With public source maps, Dev Tools can link your errors directly to the de-compiled code. It’s magical.
Chrome Dev Tools debugger using public source maps to link errors to original code.