Skip to content

Conversation

@bmeurer
Copy link
Contributor

@bmeurer bmeurer commented Feb 20, 2023

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 sources1.

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 #241

cc @victorporof

Footnotes

  1. https://developer.chrome.com/blog/devtools-better-angular-debugging

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#241

[^1]: https://developer.chrome.com/blog/devtools-better-angular-debugging
@antfu antfu merged commit e238f04 into Rich-Harris:master Feb 22, 2023
@bmeurer bmeurer deleted the feat/ignoreList branch February 22, 2023 10:53
@bmeurer
Copy link
Contributor Author

bmeurer commented Feb 22, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for x_google_ignoreList

2 participants