Skip to content
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

Improve s:resolve to also look in parent directories #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cwis-public
Copy link

Hi there,

I have recently switched one of my Node package to a “monorepo” structure, and noticed “gf” stopped working when trying to open modules contained within the monorepo.

Turned out, s:resolve wasn't exactly working like require(): in Node.JS, if some package isn't found at a point in path, Node will try all the parent folders, one by one:
https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders

This PR changes s:resolve to mimic how Node.JS works, and also adds a test for this case.

Thanks for your hard work!

Cheers,
cwis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant