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

expose defaultLoad and defaultResolve in middleware #84

Open
hardfist opened this issue May 31, 2022 · 3 comments
Open

expose defaultLoad and defaultResolve in middleware #84

hardfist opened this issue May 31, 2022 · 3 comments

Comments

@hardfist
Copy link

It seem that chaining hooks replace defaultLoad | defaultResolve with next handle , which make it's not possible access defaultLoad and defaultResolve, which is useful for some case. I'm wondering could defaultLoad and defaultResolve be exposed to context.

@JakobJingleheimer
Copy link
Contributor

JakobJingleheimer commented May 31, 2022

It's possible to access default<HookName> at the end of the chain:

--loader b.mjs --loader a.mjs

nextResolve in A will be B, and then nextResolve in B will be defaultResolve.

A loader should defer to next (and thus eventually default) when it can't handle whatever, so A can access defaultResolve through B.

@hardfist
Copy link
Author

but i want to skip other middleware and just use the defaultLoad and defaultResolve,and use it like utils

@arcanis
Copy link
Contributor

arcanis commented Jun 1, 2022

What's the use case? I can see why accessing the first loader is useful (to reset the resolution), but I don't immediately see why the last one is 🤔

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