You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my-foo depends on swc-loader which has a peer dependency on webpack and @swc/core. my-bar depends on webpack.
webpack must be a singleton or I get an error of: The 'compilation' argument must be an instance of Compilation
But my-foo's webpack points to webpack+swc_core and my-bar's webpack points to webpack.
I have to add @swc/core to my-bar (even though it doesn't use it) in order for my-foo and my-bar to use the same singleton instance.
This can get out of hand quickly.
I think we need some tooling to help with the singleton use case. Something like a pnpm doctor duplicates command to guide your through fixing it.
The problem with the status-quo, is that even if you ensure that every package uses the exact same version of a dep, they can still be using multiple instances because of the dependency sets. And with hoist=true, a random version gets chosen which is even more problematic. I am using nohoist btw.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
my-foo
depends onswc-loader
which has a peer dependency onwebpack
and@swc/core
.my-bar
depends onwebpack
.webpack
must be a singleton or I get an error of:The 'compilation' argument must be an instance of Compilation
But
my-foo
'swebpack
points towebpack+swc_core
andmy-bar
'swebpack
points towebpack
.I have to add
@swc/core
tomy-bar
(even though it doesn't use it) in order formy-foo
andmy-bar
to use the same singleton instance.This can get out of hand quickly.
I think we need some tooling to help with the singleton use case. Something like a
pnpm doctor duplicates
command to guide your through fixing it.The problem with the status-quo, is that even if you ensure that every package uses the exact same version of a dep, they can still be using multiple instances because of the dependency sets. And with
hoist=true
, a random version gets chosen which is even more problematic. I am usingnohoist
btw.Beta Was this translation helpful? Give feedback.
All reactions