Sourcemaps aren’t new, but they’re still fascinating. Neciu Dan recently wrote a good overview article.
The CSS and JavaScript we write are likely processed before they become the CSS and JavaScript sent over the internet to a browser. An obvious one is that you might author TypeScript, which is then processed into JavaScript, then bundled, then minified, and that’s what the browser actually gets.
Then let’s say there is a runtime error in that JavaScript. Without a sourcemap, all the browser can say is it looks like it’s on line 1 (because there are no line breaks in minified JavaScript, really) of app.js (or whatever your bundle is called). And it will point to some obfuscated code like function c(o,e){return 5+.5*e} — pretty useless.
At least in development, you probably want sourcemaps. Because even if you aren’t minifying and bundling in development, your TypeScript still needs to become JavaScript, and that alone is needed for DevTools to get you back to the appropriate lines of files.
With sourcemaps, browser DevTools can see that if there is an error, maybe it came from /compoments/Card/CardHooks.ts on Line 78. Useful!
This is all doubled-up in importance in the age of AI agents.
Increasingly, we’re having agents control and look at browser windows for us, with access to DevTools, so they can see runtime errors. If sourcemaps are correctly configured and available, they can use that information to trace issues back to our code when problems arise.
But what about production?!
Meaning: should we be shipping these sourcemap files that are pretty much unquestionably useful in local development out to our deployed-on-the-internet websites as well? Neciu’s article points to some things that are apparently considered bad:
Apple’s November 5, 2025, launch of a redesigned web App Store exposed its entire source code, thus revealing how a single configuration mistake can have sweeping consequences.
This happened because Apple shipped to production with sourcemaps enabled, which converts the minified bundle back into the code you wrote. Someone saw this, ran the sourcemaps, and compiled the code using a Chrome Extension that recreated their entire web Apple Store code.
I’m not convinced someone having a re-creation of your public website is some horrible security problem, as, ya know, websites are public code already, but I can see how Apple specifically is touchy.
It’s different when code is intentionally trying to be secret:
On March 31, 2026, five months on from the Apple incident, Anthropic shipped version 2.1.88 of the
@anthropic-ai/claude-codenpm package.Bundled inside was a 59.8 MB
cli.js.mapfile. It mapped roughly 1,900 files and over 512,000 lines of unobfuscated TypeScript, the complete client-side agent harness for Claude Code.
Not ideal for Anthropic there. Maybe good for us.
The conversion used to involve web performance. If you ship sourcemaps, aren’t you having users download more data?! Well, sure, if you have DevTools open, which is a niche situation at best. Not really something to worry about. You might even argue shipping sourcemaps is a high five to developers who are learning — like how we used to View Source back in the day and actually have something to look at, such does sourcemaps allow.
More relevant to today’s web is stuff like error tracking. We use and like Sentry here at CodePen to look at all the errors our servers throw so we can fix them. Sentry’s reporting is way more useful if it can point to the actual place in our authored code files that triggered the problems, and it needs sourcemaps for that. You don’t have to have public sourcemaps for Sentry to work (although it’s easier, I’d say) you can just upload them directly. So it supports the best of both worlds, if you consider sourcemaps bad or dangerous.
This has all become extra true now for AI agents. Agents looking at sites, particularly your own, but could be any, are more help in development if they can see how the runtime code maps to the authored code. I’m certainly in the business of getting AI agent help where I can get it.
Lemme leave you with three more interesting links.
- From a little while back, gotta love seeing Microsoft look at innovating new ways to speed up web apps. But this Delayed Message Timing API stuff morphed into extending the idea of Long Animation Frames (LoAF, lol) instead, which is a cool way to fight these “congested moments” and is being prototyped. Nice to see the web standards process at work.
- Mat Marquis explaining the not-so-easy to explain Proxy and Reflect abilities of JavaScript.
- mrdoob made Draco, an ultra-tiny (and faster) “mesh loader” for Three.js. It’s impressive to me I can kick out a 3D banjo in ~320KB. 250KB is Three.js, 50KB is that is Draco, and the cool stuff is only the tiny bit left there.