lanjak_obsidian-qdrant-sync/esbuild.config.mjs

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();
}