Skip to content

Commit 60808b8

Browse files
committed
Exclude .map files from embedded web UI in CLI binary
The CLI build embeds all web UI assets including 25MB of JavaScript source maps (.map files). These are only used for Sentry uploads in the hosted deployment — dead weight in a compiled Bun binary. One-line filter in build.ts's glob excludes .map files from embedding. Experiments: #2 Metric: size_kb 167,666 → 143,658 (-14.3%)
1 parent 0956b15 commit 60808b8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/opencode/script/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const createEmbeddedWebUIBundle = async () => {
6161
await $`bun run --cwd ${appDir} build`
6262
const files = (await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: dist })))
6363
.map((file) => file.replaceAll("\\", "/"))
64+
.filter((file) => !file.endsWith(".map"))
6465
.sort()
6566
const imports = files.map((file, i) => {
6667
const spec = path.relative(dir, path.join(dist, file)).replaceAll("\\", "/")

0 commit comments

Comments
 (0)