worker-loader picks up webpack5 from parent folder, not webpack4 from peer #295
Comments
You need to setup your monorepo in right way, disable hoist for webpack@4 for |
how about this?
or...
|
Still not solve, because |
But I think we can solve it for webpack@5.1, but it will be breaking change |
webpack@5.1 return |
using |
btw, I suspect this issue also might be triggered if one installs webpack 5 globally but has a package that depends on webpack 4 - the loader would pick up webpack 5 from global node_modules. |
Yes, so ideal solution do not hoist webpack in this case, just nnote - hoisting babel/ts/other packages will lead to the same problem |
We starting to rewrite our code on using |
I will update docs here for migration after |
how about the approach in #296 ? It should not create any change for any normal typical usecase and fix this hacky hoisted case |
Expected Behavior
worker-loader from subfolder loads webpack 4 (the peer dependency and the webpack that is loading the loader itself.
Actual Behavior
worker-loader loads webpack 5 version and crashes.
Code
How Do We Reproduce?
Install two copies of webpack and worker-loader as follows:
The text was updated successfully, but these errors were encountered: