murashit_codex-panel/esbuild.config.mjs

25 lines
575 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",
platform: "node",
target: "es2022",
outfile: "main.js",
sourcemap: production ? false : "inline",
minify: production,
logLevel: "info",
});
if (watch) {
await context.watch();
console.log("Watching Codex Panel plugin...");
} else {
await context.rebuild();
await context.dispose();
}