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

Use npm package require-relative to find module path #41

Open
feix760 opened this issue Mar 3, 2017 · 3 comments
Open

Use npm package require-relative to find module path #41

feix760 opened this issue Mar 3, 2017 · 3 comments

Comments

@feix760
Copy link

feix760 commented Mar 3, 2017

Many errors: Can't find file "XXXXXX" in path
We can use require-relative to eaily get real path

@moll
Copy link
Owner

moll commented Apr 4, 2017

I suspect that's because the package resolution algo I wrote for Node.vim isn't seeking for modules recursively up the chain. 😇 I should fix that as I occasionally hit that issue myself, too. As for require-relative, that's a Node module and Node.vim doesn't actually run any of its logic in JavaScript. :)

@feix760
Copy link
Author

feix760 commented Apr 17, 2017

We can use system('node vim-node.js') to exe require-relative for get path, i wrote one at https://github.com/feix760/vim-javascript-gf

@tomarrell
Copy link

I've written a small plugin that uses the package.json to resolve Node Path Relative modules https://github.com/tomarrell/vim-npr and is configurable on a project-by-project basis.

It may help out for your use case.

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

No branches or pull requests

3 participants