kwhittle_obsidian-github-tools/esbuild.config.mjs
kry-kylewhittle 0e6d173e8a Fix all community plugin review issues
- Replace fetch with Obsidian requestUrl; add typed GitHub API interfaces
- Replace all `any` types and catch blocks with proper types + errorMessage helper
- Replace createEl headings with new Setting().setHeading()
- Add void operator to all async event handlers in void context
- Fix unawaited promises (revealLeaf, activateView, saveSettings)
- Replace setTimeout with window.setTimeout throughout
- Remove unnecessary type assertions (createEl already returns typed elements)
- Replace this.display() calls with targeted DOM updates via updateDetectedInfo()
- Bump minAppVersion to 1.1.3 to match APIs used
- Replace builtin-modules package with Node built-in builtinModules
- Add GitHub Actions release workflow with artifact attestations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:17:04 +01:00

39 lines
822 B
JavaScript

import esbuild from "esbuild";
import process from "process";
import { builtinModules } from "module";
const prod = process.argv[2] === "production";
const context = await esbuild.context({
entryPoints: ["main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtinModules,
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
});
if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}