-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the import-local
module
#1376
Conversation
Approach seems good. I like how you take the relative path from the potential global directory, and then map it to a local import.
We could stub |
I think if you create a fixture directory that contains a At this point running the normal This should replace Lines 408 to 436 in 2ed9485
|
593f0d9
to
588b87a
Compare
588b87a
to
79e5075
Compare
@novemberborn Thanks for the tips. Should be good now. |
https://github.com/sindresorhus/import-local
I've used this method in a few other projects, so I thought I might as well make a module out of it.
I could use some feedback on the approach too: https://github.com/sindresorhus/import-local/blob/87a0c91a9a0ecea64471a95479b0366af296b989/index.js#L7-L10
I'm aware the existing test for this is failing. I was not sure how to properly mock this as I don't think you can use
proxyrequire
on sub-dependencies. @novemberborn Any suggestions?