mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-30 05:33:31 +00:00
31 lines
709 B
TypeScript
Executable file
31 lines
709 B
TypeScript
Executable file
#!/usr/bin/env bun
|
|
|
|
import { Script } from "@opencode-ai/script"
|
|
import path from "path"
|
|
import { fileURLToPath } from "url"
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = path.dirname(__filename)
|
|
const dir = path.resolve(__dirname, "..")
|
|
|
|
process.chdir(dir)
|
|
|
|
const generated = await import("./generate.ts")
|
|
|
|
await Bun.build({
|
|
target: "node",
|
|
entrypoints: ["./src/node.ts"],
|
|
outdir: "./dist/node",
|
|
format: "esm",
|
|
sourcemap: "linked",
|
|
external: ["jsonc-parser", "@lydell/node-pty"],
|
|
define: {
|
|
OPENCODE_MODELS_DEV: generated.modelsData,
|
|
OPENCODE_CHANNEL: `'${Script.channel}'`,
|
|
},
|
|
files: {
|
|
"opencode-web-ui.gen.ts": "",
|
|
},
|
|
})
|
|
|
|
console.log("Build complete")
|