webpack-encore
webpack-encore copied to clipboard
Add support for pnpm and Yarn PnP
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!
Fixing tests for windows is making me crazy 🤯
Thanks for doing all of this @Kocal, looks like you're almost there!
Note that due to the new required peer dependency, this requires releasing it as a new major version.
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?
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.
Re-added webpack-cli as a required peer dependency.
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.
Thanks Ryan :) I'm gonna open a recipe PR ASAP.
EDIT: opened at https://github.com/symfony/recipes/pull/1123