Skip to content

bundlers/esbuild-impl/ignore-list-source-map-plugin

Adds DevTools ignore lists to development maps and compact production maps.

Interface Description
SourceMap A version 3 source map, as far as this plugin reads and writes it.
Function Description
addIgnoreList Returns a copy of a full source map with every source that isSourceIgnored accepts listed in ignoreList.
createIgnoreListOnlySourceMap Builds a minimal source map that maps only the generated code coming from an ignore-listed source. Everything else stays unmapped, so DevTools keeps linking it to the generated script as it does with no source map at all, and only the ignore-listed regions change: DevTools skips them when it picks a message’s location. The map has no sourcesContent and no names, and one segment per region boundary, so it adds little to a minified bundle. Measured in Chrome’s own DevTools: a script whose map lists ONLY ignore-listed sources still links its unmapped frames to itself, so the plugin’s own messages keep pointing at the plugin.
ignoreListSourceMapPlugin An esbuild plugin that gives the bundle an ignore-list source map. - A development build already carries a full inline source map; this adds its ignoreList. - A production build carries none, so this makes esbuild write an external one, replaces it with the minimal map from createIgnoreListOnlySourceMap inlined into the bundle, and deletes the external files. The bundle then ends with Obsidian’s nosourcemap marker, without which Obsidian strips the map whenever debug mode is off. It must come after the toolkit’s own source-map fix, which rewrites the development map’s sources, and before the copy into the vault, which the toolkit already orders by placing custom plugins between the two.
Variable Description
DEFAULT_IGNORE_LIST_SOURCES The bundled modules that sit between a caller and a native API. DevTools skips these wrapper frames when choosing a console message’s source link.