Skip to content

Instantly share code, notes, and snippets.

@mryhryki
Last active May 1, 2024 23:30
Show Gist options
  • Save mryhryki/371c1c782c2b885d2765ac2143670ecb to your computer and use it in GitHub Desktop.
Save mryhryki/371c1c782c2b885d2765ac2143670ecb to your computer and use it in GitHub Desktop.

Log: 2024-05-02T08:20:12+09:00

Bun Version

$ bun --version
1.1.6

linux-x64

Log

  [20ms]  bundle  1 modules
   [5ms] compile  ./dist/linux-x64 bun-linux-x64-v1.1.6

Binary Size

94,843,655 Bytes

linux-arm64

Log

   [1ms]  bundle  1 modules
   [3ms] compile  ./dist/linux-arm64 bun-linux-aarch64-v1.1.6

Binary Size

90,205,769 Bytes

windows-x64

Log

   [1ms]  bundle  1 modules
   [6ms] compile  ./dist/windows-x64.exe bun-windows-x64-v1.1.6

Binary Size

101,636,897 Bytes

darwin-arm64

Log

   [1ms]  bundle  1 modules
 [148ms] compile  ./dist/darwin-arm64

Binary Size

53,017,954 Bytes

THIS_DIR="$(cd $(dirname $0); pwd)"
cd "${THIS_DIR}"
LOG_FILE="${THIS_DIR}/_log-$(date +"%Y%m%d-%H%M%S").md"
export TZ="Asia/Tokyo"
NOW="$(date +"%Y-%m-%dT%H:%M:%S+09:00")"
printf "# Log: %s\n\n" "${NOW}" | tee -a "${LOG_FILE}"
printf "## Bun Version\n\n\`\`\`shell\n$ bun --version\n%s\n\`\`\`\n\n" "$(bun --version)" | tee -a "${LOG_FILE}"
TARGETS=("linux-x64" "linux-arm64" "windows-x64" "darwin-arm64")
for target in "${TARGETS[@]}"; do
printf "## %s\n\n" "${target}" | tee -a "${LOG_FILE}"
printf "### Log\n\n\`\`\`\n" | tee -a "${LOG_FILE}"
bun build --compile --outfile="./dist/${target}" --target="bun-${target}" ./sample.ts 2>&1 | tee -a "${LOG_FILE}"
printf "\`\`\`\n\n" | tee -a "${LOG_FILE}"
printf "### Binary Size\n\n" | tee -a "${LOG_FILE}"
EXTENSION="$((echo "${target}" | grep "^windows" >/dev/null 2>&1) && printf ".exe" || printf "")"
echo "./dist/${target}${EXTENSION}"
printf "\`%'d\` Bytes\n\n" "$(wc -c < "./dist/${target}${EXTENSION}")" | tee -a "${LOG_FILE}"
done
const main = async (): Promise<void> => {
console.log("Waiting 1 second");
await new Promise((resolve) => setTimeout(resolve, 1000));
console.log("Hello, World!");
};
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment