Repository navigation
fix(cli): set NODE_ENV for Bun worker compilation - #5164
ethandaniel wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: a8bb5aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. WalkthroughThe Bun compile command now runs with Merge Risk:
|
Summary
Bun inlines
process.env.NODE_ENVwhen it compiles a worker. IfNODE_ENVis unset during compilation, the task seesdevelopmenteven when the runtime container suppliesNODE_ENV=production. This can send deployed tasks down development-only code paths. Bun compiler docsSet
NODE_ENV=productionfor thebun buildcommand only. This gives Bun the correct value at compile time and preserves the existing minification behavior.Testing
main, including the Docker regression test. The test starts withNODE_ENVunset, builds the worker, and verifies that the compiled task seesproduction.Changelog
Deployed Bun 1.4 tasks now see
NODE_ENV=productionwhen bytecode compilation is enabled.