andrewboldi_obsidian-vault-.../esbuild.config.mjs
Andrew Boldi 61d5c0edeb Phase 1: tarball-based seed via streaming fetch
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 23:37:07 -07:00

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