docs: Update Configuration.md for added special notes on usage scenarios for pnpm. #13115
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.
Added special notes on usage scenarios for pnpm.
Summary
see #12984.
I use Jest to test a tool library packaged with Rollup, which uses the two ES Module packages
lodash-es
anddayjs/esm
, since my Node.js does not support direct execution of ES Module (I There is no corresponding configuration), so I need to do conversion, and I checked the documentation, installedbabel-jest
and configuredbabel.config.js
andjest.config.js
:It works fine.
When I replaced yarn with pnpm and executed Jest for unit testing, an error occurred. Then I spent a lot of time investigating, and finally I found this Issue, which matched my scenario. I made a slight modification according to the comments below. :
It passed.
As more and more people use pnpm, I'm sure that many people will encounter this problem in the future, and an update to the documentation here is necessary to prevent more people like me from spending as much time on this problem.
So I updated the documentation.
Test plan
First, it worked on my device.
But this seems to be difficult to test. In order to design test cases, we need to use pnpm as the package manager, and construct an actual
node_modules
directory structure, and then set the corresponding structure oftransformIgnorePatterns
injest.config.js
, and then check if the package has been converted by babel.I think this seems unnecessary, so I didn't do the corresponding processing.