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

Allow to use node-resolve as a standalone module #930

Closed
raythurnvoid opened this issue Jul 4, 2021 · 2 comments
Closed

Allow to use node-resolve as a standalone module #930

raythurnvoid opened this issue Jul 4, 2021 · 2 comments

Comments

@raythurnvoid
Copy link

  • Rollup Plugin Name: plugin-node-resolve
  • Rollup Plugin Version: 13.0.0

Feature Use Case

As for now https://github.com/browserify/resolve doesn't support ESM fields (imports, exports), this is a problem for other tools including Vite which depends on it to resolve imports in SSR. I've opened an issue to Vite vitejs/vite#3953 to ask them if it is possible to replace it with https://github.com/webpack/enhanced-resolve.
This solves the issue but i find https://github.com/webpack/enhanced-resolve implementation quite hard maintain while plugin-node-resolve on the other hand is much simpler.

Feature Proposal

I would like to know if it is possible to merge implementation with https://github.com/browserify/resolve or if it's possible to create a standalone function that can be called outside of the rollup context (so without depending on the this valorized by rollup)

@stale stale bot added the x⁷ ⋅ stale label Sep 2, 2021
@stale
Copy link

stale bot commented Sep 4, 2021

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

@stale stale bot closed this as completed Sep 4, 2021
@dmnsgn
Copy link

dmnsgn commented May 16, 2023

A good start to this would be to expose/re-export resolveImportSpecifiers in node-resolve index.js:

https://github.com/rollup/plugins/blob/b3a65b9b761f7ebbe03d1991cf5ac038f0c2f5a6/packages/node-resolve/src/index.js#LL13C8-L13C31

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

No branches or pull requests

2 participants