allexcd_obsidian-mcp/packages/plugin/esbuild.config.mjs
2026-04-30 20:19:24 +02:00

25 lines
580 B
JavaScript

import esbuild from "esbuild";
const production = process.argv.includes("--production");
const watch = process.argv.includes("--watch");
const context = await esbuild.context({
entryPoints: ["src/main.ts"],
bundle: true,
external: ["obsidian"],
format: "cjs",
target: "es2020",
logLevel: "info",
sourcemap: production ? false : "inline",
treeShaking: true,
outfile: "main.js",
minify: production
});
if (watch) {
await context.watch();
console.log("Watching MCP Vault Bridge plugin...");
} else {
await context.rebuild();
await context.dispose();
}