fix(plugin-react): jsxDev is not a function when is set NODE_ENV in env files#10861
Merged
patak-cat merged 4 commits intovitejs:mainfrom Nov 15, 2022
Merged
fix(plugin-react): jsxDev is not a function when is set NODE_ENV in env files#10861patak-cat merged 4 commits intovitejs:mainfrom
patak-cat merged 4 commits intovitejs:mainfrom
Conversation
Member
|
@Dunqing would it be possible to modify the react playground to test this so we avoid a regression later? |
Contributor
Author
Sure! |
patak-cat
previously approved these changes
Nov 11, 2022
IanVS
previously approved these changes
Nov 14, 2022
packages/plugin-react/src/index.ts
Outdated
| enforce: 'pre', | ||
| config(_, { mode }) { | ||
| config(userConfig, { mode }) { | ||
| // Copied from https://github.com/vitejs/vite/blob/4e9bdd4fb3654a9d43917e1cb682d3d2bad25115/packages/vite/src/node/config.ts#L488-L490 |
Contributor
There was a problem hiding this comment.
This comment range could be expanded, since we're now copying more of that logic.
Maybe something like: https://github.com/vitejs/vite/blob/4e9bdd4fb3654a9d43917e1cb682d3d2bad25115/packages/vite/src/node/config.ts#L477-L494
Contributor
Author
There was a problem hiding this comment.
Thank you for your review!
IanVS
approved these changes
Nov 15, 2022
patak-cat
approved these changes
Nov 15, 2022
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fix: #10854
We need to execute loadEnv, because
process.env.VITE_USER_NODE_ENVis only defined in it.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).