patruusbarba_ObsidianSpoile.../esbuild.config.mjs
root 118866ceff Address community review warnings
- Drop plugin id/name from command id and name
- Replace builtin-modules dep with node:module builtinModules
- Commit package-lock.json for reproducible builds

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 23:32:21 +00:00

35 lines
775 B
JavaScript

import esbuild from "esbuild";
import process from "process";
import { builtinModules } from "module";
const builtins = [...builtinModules, ...builtinModules.map((m) => `node:${m}`)];
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
`;
const prod = process.argv[2] === "production";
const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts"],
bundle: true,
external: ["obsidian", "electron", ...builtins],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
});
if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}