Laravel-mix: Add support for pnpm

Created on 10 Apr 2019  路  10Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 4.0.15 (npm list --depth=0)
  • Node Version (node -v): v11.7.0
  • NPM Version (npm -v):6.8.0
  • OS: Linux Mint 18.04

Description:

You are installing missing dependencies using yarn and npm. Can you add support for pnpm? It reduces the size of node_modules folder. Here is the official explanation

pnpm uses hard links and symlinks to save one version of a module only ever once on a disk. When using npm or Yarn for example, if you have 100 projects using the same version of lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be saved in a single place on the disk and a hard link will put it into the node_modules where it should be installed. As a result, you save gigabytes of space on your disk and you have a lot faster installations

Steps To Reproduce:

When you enable browsersync and run $ pnpm run watch it installs browsersync using yarn by default

...
Additional dependencies must be installed. This will only take a moment.
Running: yarn add browser-sync [email protected] --dev --production=false
...

stale

Most helpful comment

@ankurk91 I don't mean pnp but pnpm...

https://pnpm.js.org/

node_modules/laravel-mix/src/Verify.js@installDependencies

All 10 comments

It is not that easy.

BTW, it is pnp
https://yarnpkg.com/lang/en/docs/pnp/
not pnpm

@ankurk91 I don't mean pnp but pnpm...

https://pnpm.js.org/

node_modules/laravel-mix/src/Verify.js@installDependencies

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Up 馃敟

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I think this ought to be re-opened. yarn 2 includes plug-n-play support by default. This does not work when referencing a webpack file in node_modules folder.

I would also like to see support for this as I'm using Yarn 2 which is plug-n-play.
@gferreri is there any workaround?

This issue has nothing to do with plug-n-play, its for the pnpm package manager

Support for https://pnpm.js.org/ would be really helpful :)

Related: https://github.com/pnpm/pnpm/issues/1083

Final solution:

echo "shamefully-hoist=true" > .npmrc
pnpm add vue-template-compiler -D
pnpm add dotenv -D

Now you can use it!

pnpm run watch
# or
pnpm run dev
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Micaso picture Micaso  路  3Comments

dtheb picture dtheb  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

pixieaka picture pixieaka  路  3Comments