mirror of
https://github.com/lanjak/obsidian-qdrant-sync.git
synced 2026-07-22 08:32:54 +00:00
23 lines
512 B
JavaScript
23 lines
512 B
JavaScript
import esbuild from "esbuild";
|
|
|
|
const production = process.argv[2] === "production";
|
|
|
|
const context = await esbuild.context({
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
external: ["obsidian", "electron", "@codemirror/*", "@lezer/*"],
|
|
format: "cjs",
|
|
target: "es2020",
|
|
logLevel: "info",
|
|
sourcemap: production ? false : "inline",
|
|
treeShaking: true,
|
|
outfile: "main.js",
|
|
minify: production,
|
|
});
|
|
|
|
if (production) {
|
|
await context.rebuild();
|
|
process.exit(0);
|
|
} else {
|
|
await context.watch();
|
|
}
|