omega restructuring + a bunch of changes i have made over the last weeks

This commit is contained in:
Sebastian Moser
2026-07-31 00:48:15 +02:00
parent c57849f748
commit b2ed9efff2
201 changed files with 4331 additions and 49073 deletions

View File

@@ -0,0 +1,56 @@
import esbuild from "esbuild";
import process from "node:process";
import builtins from "builtin-modules";
import { denoPlugin } from "@deno/esbuild-plugin";
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
*/
`;
const prod = process.argv[2] === "production";
const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["plugin.ts"],
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: "es2020",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "dist/main.js",
loader: {
".wasm": "binary",
".workerjs": "text",
},
define: {
"import.meta.url": '"obsidian-plugin"',
},
plugins: [denoPlugin()],
});
if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}