mirror of
https://github.com/swartzrock/obsidian-settings-float-plugin.git
synced 2026-07-22 07:48:42 +00:00
23 lines
512 B
JavaScript
23 lines
512 B
JavaScript
import esbuild from "esbuild";
|
|
|
|
const production = process.argv.includes("production");
|
|
|
|
const context = await esbuild.context({
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
external: ["obsidian", "electron", "@codemirror/*"],
|
|
format: "cjs",
|
|
target: "es2020",
|
|
platform: "browser",
|
|
logLevel: "info",
|
|
sourcemap: production ? false : "inline",
|
|
treeShaking: true,
|
|
outfile: "main.js",
|
|
});
|
|
|
|
if (production) {
|
|
await context.rebuild();
|
|
await context.dispose();
|
|
} else {
|
|
await context.watch();
|
|
}
|