Open cwis-public opened 5 years ago
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
s:resolve
require()
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
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 likerequire()
: 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_foldersThis 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