Skip to content

Commit cfc087c

Browse files
build(bin): embed sourcemaps in the compiled binary (#1213)
* build(bin): embed sourcemaps in the compiled binary Crash stacks from the standalone binary pointed at minified frames with no source mapping, leaving production failures unactionable. An embedded sourcemap restores file-and-line stacks at a small size cost. * build(release): embed sourcemaps in release binaries
1 parent bbc5ec5 commit cfc087c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"scripts": {
3232
"build": "bun build ./src/index.ts --outdir ./dist --target bun --external '@opentui/core-*' && bun scripts/copy-repo-plugins.ts",
33-
"build:bin": "bun build ./src/index.ts --compile --minify --define process.env.NODE_ENV='\"production\"' --outfile ./dist/corbits && ([ \"$(uname -s)\" != Darwin ] || codesign -s - --force ./dist/corbits) && bun scripts/copy-repo-plugins.ts",
33+
"build:bin": "bun build ./src/index.ts --compile --minify --sourcemap --define process.env.NODE_ENV='\"production\"' --outfile ./dist/corbits && ([ \"$(uname -s)\" != Darwin ] || codesign -s - --force ./dist/corbits) && bun scripts/copy-repo-plugins.ts",
3434
"typecheck": "tsc --noEmit",
3535
"test": "bun test ./src ./e2e ./evals ./scripts ./testkit --randomize --seed 424242",
3636
"test:paths": "bun scripts/test-paths.ts",

‎scripts/release.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ host_label() {
145145
# `codesign` only exists on macOS hosts, which is where darwin releases are cut.
146146
compile_bin() { # compile_bin BUN_TARGET OUTFILE
147147
local target=$1 out=$2
148-
bun build ./src/index.ts --compile --target="$target" --minify \
148+
bun build ./src/index.ts --compile --target="$target" --minify --sourcemap \
149149
--define process.env.NODE_ENV='"production"' \
150150
--define process.env.DEV='"false"' \
151151
--outfile "$out" >/dev/null

0 commit comments

Comments
 (0)