fix: add react-dom
in optimizeOps
to handle CJS script.
#375
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
The inclusion of
react
introduced in vite#9056 but not forreact-dom
. Sincereact-dom
is a standalone package even in React 18, we should include it without problems to have consistent behavior.Additional context
By merging this commit, CJS format js files like react-dom/client.js and react-dom/index.js will be enforced optimized, just like
react
's index.js.Optimization of these files will help not-well designed (import non-default exported modules
react
andreact-dom
directly) frameworks correctly import package without developer's notice, when using the development mode of vite, e.g. resolve radix-ui/primitives#3114. More discussion of original inclusion can be seen at vite#9052/commentWhat is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).