esbuild-plugin-obsidian
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

esbuild-plugin-obsidian

An esbuild plugin for creating Obsidian plugins.

Usage

Inside your esbuild build script:

import * as esbuild from 'esbuild';
import esbuildObsidian from 'esbuild-plugin-obsidian';

await esbuild.build({
	// ...
	plugins: [esbuildObsidian(/* options */)],
});

Inside your package.json file:

{
	"name": "my-plugin",
	"version": "1.2.3",
	"author": "me",
	"obsidian": {
		"name": "My Plugin Name",
		"minAppVersion": "1.0.0",
		"isDesktopOnly": false
	}
}

Options

interface Options {
	/**
	 * The path to the `package.json` file that will be used for creating the plugin manifest.
	 */
	packageJsonFile?: string;

	/**
	 * A list of plugin build warnings to ignore.
	 */
	ignoreWarnings?: string[];

	/**
	 * The path to write the `manifest.json` file to.
	 *
	 * This is relative to the working directory, and *does not* respect `outDir`.
	 * Publishing an Obsidian plugin requires that `manifest.json` is in the repository root.
	 */
	outManifestFile?: string;

	/**
	 * The path to write the `versions.json` file to.
	 *
	 * This is relative to the working directory, and *does not* respect `outDir`.
	 * Publishing an Obsidian plugin requires that `versions.json` is in the repository root.
	 */
	outVersionsFile?: string;
}

Features

  • Automatically generates and updates versions.json.
  • Generates a manifest.json based on the package.json file.
    • Package name as plugin ID.
    • Package version as the plugin version.
    • Package description as plugin description.
    • Package author for the plugin author name and URL.
    • Package funding field for the plugin funding URL.
    • All manifest fields can be overridden in the obsidian field.

Readme

Keywords

Package Sidebar

Install

npm i esbuild-plugin-obsidian

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

21.1 kB

Total Files

6

Last publish

Collaborators

  • eth-p