Skip to content

Commit 00e2f0a

Browse files
committed
feat(build): add --static flag to build static assets
Adds a --static flag that builds the web static assets and copies them to the static/ directory for Docker/server deployments. Usage: bun run build --static
1 parent 82aa01e commit 00e2f0a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/opencode/script/build.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Script } from "@opencode-ai/script"
1818
const singleFlag = process.argv.includes("--single")
1919
const baselineFlag = process.argv.includes("--baseline")
2020
const skipInstall = process.argv.includes("--skip-install")
21+
const staticFlag = process.argv.includes("--static")
2122

2223
const allTargets: {
2324
os: string
@@ -170,4 +171,13 @@ for (const item of targets) {
170171
binaries[name] = Script.version
171172
}
172173

174+
// Build static directory for Docker/server deployments
175+
if (staticFlag) {
176+
console.log("building static assets...")
177+
const desktopDir = path.resolve(dir, "../desktop")
178+
await $`bun run build`.cwd(desktopDir)
179+
await $`cp -r ${desktopDir}/dist ${dir}/static`
180+
console.log("static assets built to ./static")
181+
}
182+
173183
export { binaries }

0 commit comments

Comments
 (0)