Reputation: 14365
In Webpack 4,
I want to place my rsg-components
instead of the one in node_modules
.
So react-styleguidist
will import my version instead.
Apparently resolve.alias
doesn't take precedence over node_modules
, is there a way to do so without forking react-stylguidist
?
Upvotes: 3
Views: 4194
Reputation: 3322
You can use resolve-modules.
Just add the directory where your module is before node_modules
.
From the documentation:
If you want to add a directory to search in that takes precedence over node_modules/:
modules: [path.resolve(__dirname, "src"), "node_modules"]
Upvotes: 5