sindresorhus / import-local

Let a globally installed package use a locally installed version of itself if available
MIT License
154 stars 11 forks source link

Support Yarn aliases #2

Closed mxmul closed 5 years ago

mxmul commented 5 years ago

Fixes #1.

The current implementation noops if it finds a "local" copy of the file at the exact same path as the "global" one (i.e. when the file actually was installed locally). This diff maintains that behavior, but also noops if the filename is installed anywhere under the local node_modules. Now calling importLocal on a file that is aliased inside local node_modules is guaranteed to do nothing.

jdb8 commented 5 years ago

@sindresorhus would be great to get this merged if possible! Causing some issues for us with the way we alias dev deps.

sindresorhus commented 5 years ago

Can you fix the merge conflict?

mxmul commented 5 years ago

Updated the PR – it should merge cleanly now.