mirror of
https://github.com/allexcd/obsidian-mcp.git
synced 2026-07-22 06:50:59 +00:00
25 lines
580 B
JavaScript
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();
|
|
}
|