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

Add "go to file" for js imports/requires #23

Open
sdeleon28 opened this issue May 15, 2017 · 5 comments
Open

Add "go to file" for js imports/requires #23

sdeleon28 opened this issue May 15, 2017 · 5 comments

Comments

@sdeleon28
Copy link
Owner

Should resolve module-resolver entries properly. Use babel-node's `require.resolve'.

@sdeleon28
Copy link
Owner Author

Implemented a resolver that can handle:

  • Absolute imports using babel's require.resolve
  • Relative imports adding a .js extension to the reference

Pending:

  • Resolve references to index.js files that don't include the index part

@sdeleon28
Copy link
Owner Author

I could probably change the directory from which babel is calculating relative imports from. In that case, all I need to do is change the contents of the ___resolve.js script and use that method always (instead of manually calculating the path for relative imports).

@sdeleon28
Copy link
Owner Author

Otherwise, I can try to find the reference by inspecting filesystem contents. If adding .js results in a file, :edit that one. If it doesn't, try appending /index.js instead. If that still doesn't produce a file, show an error.

@sdeleon28
Copy link
Owner Author

I should also change the name of ___resolve.js to something even more unlikely to exist.

@sdeleon28
Copy link
Owner Author

sdeleon28 commented May 17, 2017

  • Try doing the resolution by using babel only
  • Otherwise, try resolving manually
  • Rename ___resolve.js

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

1 participant