Rich-Harris / magic-string

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

feat: add the ability to ignore-list sources #243

Closed bmeurer closed 1 year ago

bmeurer commented 1 year ago

This adds the ability to mark sources emitted into a source map as ignore-listed, which provides a hint that debuggers can utilize when dealing with these sources^1.

The ignoreList option can be passed to a MagicString now, and will be considered when generating a source map for it. In addition that bit will also be considered when the MagicString is added as source to a Bundle (with the possibility to override the value via a parameter to addSource). The x_google_ignoreList field in the source map will only be emitted if at least one of its sources was explicitly marked with ignoreList: true. Otherwise - and primarily for backwards compatibility with the existing ecosystem - no x_google_ignoreList field is emitted.

Fixes Rich-Harris/magic-string#241

cc @victorporof

bmeurer commented 1 year ago

Thanks!