mirror of
https://github.com/utleysam/codeblock-crbasic.git
synced 2026-07-22 07:32:57 +00:00
37 lines
756 B
JavaScript
37 lines
756 B
JavaScript
import esbuild from "esbuild";
|
|
import process from "process";
|
|
|
|
const watch = process.argv.includes("--watch");
|
|
|
|
const context = await esbuild.context({
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
format: "cjs",
|
|
target: "es2020",
|
|
platform: "browser",
|
|
sourcemap: false,
|
|
outfile: "main.js",
|
|
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",
|
|
],
|
|
logLevel: "info",
|
|
});
|
|
|
|
if (watch) {
|
|
await context.watch();
|
|
} else {
|
|
await context.rebuild();
|
|
await context.dispose();
|
|
}
|