mirror of
https://github.com/sean2077/obsidian-dynamic-theme-background.git
synced 2026-07-22 06:44:57 +00:00
Migrate custom query credentials to SecretStorage and apply custom parameters at request time. Preserve configuration-order scheduling, transactional reorder rollback, and older Obsidian fallback metadata. Align the production bundle with the official ES2021 target while retaining the frozen size gates.
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
import esbuild from "esbuild";
|
|
import { builtinModules } from "node:module";
|
|
import process from "process";
|
|
|
|
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: ["src/main.ts"],
|
|
bundle: true,
|
|
charset: "utf8",
|
|
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",
|
|
...builtinModules],
|
|
format: "cjs",
|
|
target: "es2021",
|
|
logLevel: "info",
|
|
sourcemap: prod ? false : "inline",
|
|
treeShaking: true,
|
|
outfile: "main.js",
|
|
minify: prod,
|
|
pure: prod ? ["console.debug"] : [],
|
|
});
|
|
|
|
if (prod) {
|
|
await context.rebuild();
|
|
process.exit(0);
|
|
} else {
|
|
await context.watch();
|
|
}
|