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
feat(react): allow setting react preset to production when using custom BABEL_ENV #19148
feat(react): allow setting react preset to production when using custom BABEL_ENV #19148
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
packages/react/babel.ts
Outdated
const reactPresetOptions: Record<string, string | boolean> = { | ||
runtime: presetOptions.runtime ?? 'automatic', | ||
development: env !== 'production', | ||
development: |
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.
I'd rather keep the option development
to match the @babel/preset-react
option, so it's clear that it is an override.
So something like:
development: presetOptions.development ?? env !== 'production'
ba298c2
to
581c751
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When setting a custom BABEL_ENV, the @nx/react babel preset will pass
development: true
to the react babel preset. This may not be desirable, if you know that you are running webpack in production mode as it can cause errors.Expected Behavior
You can pass an option to force
development: false
Related Issue(s)
Fixes #