7

I use vite on react, and when i use yarn to "live server" my project two new files are created, .pnp.loader.mjs and .pnp.cjs. What is the purpose of this files? I never see those files, always use npm or yarn and is the first time that they appear.

files

yivi
  • 42,438
  • 18
  • 116
  • 138
Esteban Sabo
  • 71
  • 1
  • 6

2 Answers2

4

The .pnp.cjs is part of the Yarn Plug'n'Play process, which makes our install and runtime much faster. It makes the node_modules obsolete.

Yarn also creates an experimental ESM loader which is called .pnp.loader.mjs.

0

npx create-next-app@latest npx next dev

The issue is from Yarn @Jan Willems says