mirror of
https://github.com/andrewboldi/obsidian-vault-sync.git
synced 2026-07-22 06:53:35 +00:00
32 lines
727 B
JavaScript
32 lines
727 B
JavaScript
import esbuild from "esbuild";
|
|
import process from "process";
|
|
|
|
const banner = `/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source visit https://github.com/andrewboldi/obsidian-vault-sync
|
|
*/
|
|
`;
|
|
|
|
const prod = process.argv[2] === "production";
|
|
|
|
const context = await esbuild.context({
|
|
banner: { js: banner },
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
external: ["obsidian", "electron"],
|
|
format: "cjs",
|
|
target: "es2020",
|
|
logLevel: "info",
|
|
sourcemap: prod ? false : "inline",
|
|
treeShaking: true,
|
|
platform: "browser",
|
|
minify: prod,
|
|
outfile: "main.js",
|
|
});
|
|
|
|
if (prod) {
|
|
await context.rebuild();
|
|
process.exit(0);
|
|
} else {
|
|
await context.watch();
|
|
}
|