Skip to content

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.

Import:

import { ignoreListSourceMapPlugin } from '@mnaoumov/obsidian-dev-toolkit/bundlers/esbuild-impl/ignore-list-source-map-plugin';

Signature:

function ignoreListSourceMapPlugin(additionalSources: readonly RegExp[]): Plugin

Parameters:

Parameter Type Description
additionalSources readonly RegExp[] Patterns added to DEFAULT_IGNORE_LIST_SOURCES.

Returns: Plugin — The esbuild plugin.