fix: USE_MAGICK build flag - use define instead of bun:bundle

The bun:bundle module only exists at bundle time, not when running source
directly (dev/tests). This caused CI failures with:
  error: Cannot find package 'bundle'

Fix: Use Bun.build's define option to set __USE_MAGICK__ as a compile-time
constant. At dev/test time it's undefined (defaults to false/sharp).
At build time it's set based on USE_MAGICK env var.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
This commit is contained in:
cpacker
2026-01-29 15:02:07 -08:00
parent ad95f79133
commit 13b627e28a
2 changed files with 11 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ await Bun.build({
define: {
LETTA_VERSION: JSON.stringify(version),
BUILD_TIME: JSON.stringify(new Date().toISOString()),
__USE_MAGICK__: useMagick ? "true" : "false",
},
// Load text files as strings (for markdown, etc.)
loader: {