-
Notifications
You must be signed in to change notification settings - Fork 1k
Set default values when statically replacing process.env.NODE_ENV
#11027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: f181512 The changes in this PR will be included in the next version bump. 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 |
db2eef5 to
2d8c56f
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks James.
LGTM with a few minor nits.
36105c6 to
797f68d
Compare
797f68d to
f181512
Compare
Fixes #10983.
Fixes #10984.
Fixes #9802.
Fixes #7886.
Statically replace the value of
process.env.NODE_ENVwithdevelopmentfor development builds andproductionfor production builds if it is not set. Else, use the given value. This ensures that libraries, such as React, that branch code based onprocess.env.NODE_ENVcan be properly tree shaken.Note that this effectively duplicates the logic we already have in the Vite plugin