-
Notifications
You must be signed in to change notification settings - Fork 17
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
Proposal: preImport loader hook #83
Comments
This is an interesting idea! I have a couple questions:
I'm a little concerned by the P.S. Sorry for the delayed reply; I'm only just seeing this now. |
It's a
Ahh thanks for spotting the issue in the example, that should be
My preference would have been to just call it the Yes, both |
Closing in favor of #89 |
A
preImport
hook can take the place of the async use cases for having an async resolver hook by allowing any async work to be done upfront before triggering the further pipeline steps. For example, loading an import map could be an async operation prior to synchronously using that import map in resolution (which is exactly what the browser does).Ultimately, the goal would be that by covering these needs, this should allow for a synchronous core resolver which would enable unification with browser resolution.
The initial hook PR would not deprecate the resolver yet, and could be released to get feedback on this first, before following up with a subsequent async resolver deprecation.
There is a basic draft API in nodejs/node#43245, with the following documentation:
The text was updated successfully, but these errors were encountered: