mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
26 lines
595 B
JavaScript
26 lines
595 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",
|
|
jsx: "automatic",
|
|
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();
|
|
}
|