Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/minify-standalone-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kitlangton/ghui": patch
---

Reduce standalone binary and release tarball size by minifying compiled builds.
2 changes: 1 addition & 1 deletion dev/build-npm-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const buildBinaryPackage = async (target: ReleaseTarget) => {
if (reuseReleaseBinary && (await Bun.file(releaseBinaryPath).exists())) {
await cp(releaseBinaryPath, binaryPath)
} else {
run(["bun", "build", "--compile", "--bytecode", "--format=esm", `--target=${target.bunTarget}`, `--outfile=${binaryPath}`, "src/standalone.ts"])
run(["bun", "build", "--compile", "--bytecode", "--minify", "--format=esm", `--target=${target.bunTarget}`, `--outfile=${binaryPath}`, "src/standalone.ts"])
}
await chmod(binaryPath, 0o755)
await cp(join(root, "LICENSE"), join(packageDir, "LICENSE"))
Expand Down
2 changes: 1 addition & 1 deletion dev/build-standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ for (const target of selectedTargets()) {
const assetPath = join(releaseDir, assetName)

await mkdir(stageDir, { recursive: true })
run(["bun", "build", "--compile", "--bytecode", "--format=esm", `--target=${target.bunTarget}`, `--outfile=${binaryPath}`, "src/standalone.ts"])
run(["bun", "build", "--compile", "--bytecode", "--minify", "--format=esm", `--target=${target.bunTarget}`, `--outfile=${binaryPath}`, "src/standalone.ts"])
await chmod(binaryPath, 0o755)

if (target.id === hostTargetId) {
Expand Down