webpack-encore icon indicating copy to clipboard operation
webpack-encore copied to clipboard

Add support for pnpm and Yarn PnP

Open Kocal opened this issue 3 years ago • 1 comments

For Yarn PnP and pnpm support, Encore needs to configure peerDependenciesMeta as explained in #655.

I've configured every packages listed in lib/features.js as optional peerDependencies, and webpack as a required peer dependency.

I'm not sure of how we can write tests for that, any idea @weaverryan? Maybe an E2E test with a real app/dedicated CI workflow? EDIT: implemented E2E tests for Yarn PnP and pnpm.

Thanks!

Kocal avatar Aug 02 '22 07:08 Kocal

Fixing tests for windows is making me crazy 🤯

Kocal avatar Aug 02 '22 20:08 Kocal

Thanks for doing all of this @Kocal, looks like you're almost there!

arderyp avatar Aug 18 '22 20:08 arderyp

Note that due to the new required peer dependency, this requires releasing it as a new major version.

stof avatar Aug 27 '22 13:08 stof

Note that due to the new required peer dependency, this requires releasing it as a new major version

I was thinking the same, which is ok. To be clear, the new peer dependency is webpack itself.

So I'm still wondering about webpack-cli. This is NOT currently listed as a peerDependency. However, in all of the "test apps", it IS installed. Why isn't this a required peer dependency?

weaverryan avatar Aug 29 '22 14:08 weaverryan

It is an optional peer dependency of webpack, that must be installed to be able to use webpack in the CLI (rather than using it programmatically). And so, in Encore, we need it.

I suggest adding webpack-cli as a mandatory peer dependency of Encore, instead of having the first usage of Encore failing and asking the user to install webpack-cli.

stof avatar Aug 29 '22 14:08 stof

Re-added webpack-cli as a required peer dependency.

Kocal avatar Aug 29 '22 20:08 Kocal

Thank you Hugo for taking this on! Can you open a recipe PR - we will need to include webpack and webpack-cli in package.json and bump to v4 of Encore. I'm not going to tag quite yet, because I haven't played with this yet and I'd like to get comfortable and do some local testing first.

weaverryan avatar Aug 30 '22 18:08 weaverryan

Thanks Ryan :) I'm gonna open a recipe PR ASAP.

EDIT: opened at https://github.com/symfony/recipes/pull/1123

Kocal avatar Aug 31 '22 05:08 Kocal