obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
19 lines (18 loc) • 969 B
text/typescript
/**
* @packageDocumentation
*
* This module defines an esbuild plugin that fixes source maps generated during development.
* It adjusts the paths in the source maps to be compatible with Obsidian's internal URL scheme.
* A plugin is only active during development builds.
*/
import type { Plugin } from 'esbuild';
/**
* Creates an esbuild plugin that fixes source maps by adjusting the paths to be compatible
* with Obsidian's internal URL scheme.
*
* @param isProductionBuild - A boolean indicating whether the build is a production build. The plugin only runs in non-production builds.
* @param distPaths - The paths to the output files containing the source maps.
* @param pluginName - The name of the Obsidian plugin, used to construct the Obsidian-specific URLs.
* @returns An esbuild `Plugin` object that fixes source maps.
*/
export declare function fixSourceMapsPlugin(isProductionBuild: boolean, distPaths: string[], pluginName: string): Plugin;