sixtarocyan_smart-folder-view/esbuild.config.mjs

22 lines
No EOL
438 B
JavaScript

import esbuild from "esbuild";
const prod = process.argv[2] === "production";
const context = await esbuild.context({
entryPoints: ["src/main.ts"],
bundle: true,
external: ["obsidian"],
format: "cjs",
target: "es2020",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
});
if (prod) {
await context.rebuild();
await context.dispose();
} else {
await context.watch();
}