Skip to content

script-utils/bundlers/esbuild-impl/obsidian-plugin-builder

This module provides functionality to build and bundle an Obsidian plugin using esbuild. It includes functions to handle the build process based on different build modes (development or production), and it sets up various esbuild plugins to preprocess, lint, fix source maps, and copy files to the Obsidian plugins folder.

InterfaceDescription
BuildObsidianPluginParamsOptions for buildObsidianPlugin.
BuildOptionsBuild parameters without the mode field, for use with build and dev.
FunctionDescription
buildBuilds the Obsidian plugin in production mode using esbuild.
buildObsidianPluginBuilds the Obsidian plugin based on the specified mode and configuration folder.
devBuilds the Obsidian plugin in development mode using esbuild with watch. In addition to esbuild’s own source-graph watch, the development build also watches the plugin’s node_modules folder and restarts the whole build (including the type-check) when it changes, so a dependency reinstall or rebuild is picked up.
invokeEsbuildInvokes the build process with the provided build context.
EnumDescription
BuildModeEnumeration representing the build modes.
VariableDescription
bannerBanner text to be included at the top of the generated files.