esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

[FEATURE REQUEST] Generate `x_google_ignoreList` sourcemap extension field

Open clydin opened this issue 2 years ago • 1 comments

The x_google_ignoreList extension field helps provide an improved developer debugging experience by reducing the information shown for known third-party code in stack traces and browser dev tools source file lists. The field is supported within Chrome's DevTools and recently support was added to Firefox as well. While the field can be added via a plugin's onEnd callback and looping through the output files, this can be an expensive operation due to the need to parse, analyze, and then re-serialize the JSON for each sourcemap (some of which can be quite large). Implementing this within esbuild itself should hopefully allow for the creation of the field during sourcemap generation and avoid the plugin overhead.

By default all files found within a node_modules directory could be included. An additional esbuild option may also be useful to adjust what input files would be included. The option could potentially be similar to the format of the external option with wildcard support.

Some information regarding the field: https://developer.chrome.com/articles/x-google-ignore-list/ https://firefox-source-docs.mozilla.org/devtools-user/debugger/how_to/ignoring_sources/index.html#ignore-third-party-scripts

clydin avatar Jun 21 '23 16:06 clydin

If this is to be implemented, this should probably use the standard ignoreList field instead now that source maps are an actual standard: https://tc39.es/ecma426/.

evanw avatar Feb 04 '25 22:02 evanw