uthvah_sync-embeds/esbuild.config.mjs
Verity 675ca16fa9 fix: resolve Obsidian scorecard warnings and readable-line-width padding bug
- Replace deprecated builtin-modules with node:module built-in
- Pin monkey-around to exact version 3.0.0
- Upgrade esbuild 0.17.3 → 0.28.1 (fixes high-severity CVE)
- Commit package-lock.json for reproducible builds
- Add CONTRIBUTING.md and GitHub Actions release workflow with artifact attestation
- Fix #ccc shorthand hex in print styles
- Neutralize Obsidian's readable-line-width per-line margin-inline inside sync embeds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 16:32:22 +01:00

51 lines
No EOL
1.1 KiB
JavaScript

import esbuild from "esbuild";
import process from "process";
import { builtinModules as builtins } from "node:module";
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.env.NODE_ENV === 'production';
const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["src/main.js"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js", // Outputs to root for Obsidian
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
},
});
if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}