Rich-Harris / magic-string

Manipulate strings like a wizard
MIT License
2.37k stars 113 forks source link

feat: Add support for sourcemap `debugId` property #292

Closed timfish closed 6 days ago

timfish commented 6 days ago

Debug IDs are unique uuids added to both source and sourcemaps so sourcemaps can more easily be identified in production. See the TC39 proposal for more details

I've recently added support for emitting debug IDs in Rollup, webpack and Rolldown.

Even though this has been released in Rollup, it doesn't work In Vite yet because the debug ID gets removed from every sourcemap when a later plugin makes modifications to the sourcemap. I think I've tracked this down to magic-string!