pnp. cjs file instead of the usual node_modules folder containing copies of various packages. The . pnp. cjs file contains various maps: one linking package names and versions to their location on the disk and another one linking package names and versions to their list of dependencies.
Verdict: Should you use it? When Yarn PNP works well, it's amazing. Installation is fast, you use far less disk space, and you can't accidentally depend on any transitive dependencies. Unfortunately, my conclusion is that you end up spending a non-trivial amount of your novelty budget in order to make it work.
1 Answer. Show activity on this post. yarn 2 does not use or create node_modules directory by default, instead it uses a new technology called plug 'n play (pnp).
Yarn includes an optional "Plug'n'Play" feature which moves node_modules
out of the project directory. In doing so it creates a .pnp.js
file with references to various dependency paths on the hard drive.
The file is auto-generated, is several thousand lines long, and appears to reference paths specific to the machine that ran yarn install
.
Is .pnp.js
meant to be commited with the rest of the code? I can't seem to find any information about this despite the file appearing to be useless to commit. What is conisdered best practice and why?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With