-
Notifications
You must be signed in to change notification settings - Fork 472
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(module factory): add before_resolve hook #2940
Conversation
|
Please rebase the main branch. |
maybe you could try |
I don't know why this only happened to me, I didn't reproduce it on gitpod.io. |
Maybe related to #2912, I will investigate this issue when I have time. |
Would you mind resolving conflicts? Overall, this pull request looks good to me. |
# Conflicts: # crates/node_binding/binding.d.ts
sure |
# Conflicts: # crates/rspack_core/src/normal_module_factory.rs
I'm done |
it looks ready to merge if you could address the rest of the two issues. |
this.#updateDisableHooks() like this https://github.com/web-infra-dev/rspack/pull/2940/files#diff-65c9f2211aa3417321f820555fd1ec4a9647fdc6cba3c80c2b96587a4d4ad4fdR417 I don't quite understand the problem. Everything else has been solved |
What about this one? |
https://crates.io/crates/tracing/versions |
nice point, LGTM |
Related issue (if exists)
#2788
Summary
馃 Generated by Copilot at 22b4de9
Added a new plugin hook for normal module resolution in
rspack_core
. This hook allows plugins to modify or skip the default module resolution logic inNormalModuleFactory
. The hook is implemented by thePlugin
trait and thePluginDriver
struct, and uses theNormalModuleBeforeResolveArgs
struct to pass the relevant information.Walkthrough
馃 Generated by Copilot at 22b4de9
before_resolve
hook toPlugin
trait andPluginDriver
struct to allow plugins to intercept and modify module resolution (link, link)NormalModuleFactory
to invokebefore_resolve
hook before resolving module dependency usingResolveArgs
struct (link, link, link)NormalModuleBeforeResolveArgs
struct inplugin::args
andplugin::api
to hold information about module dependency and context forbefore_resolve
hook (link, link)PluginNormalModuleFactoryBeforeResolveOutput
type alias inplugin::api
to represent possible outcomes ofbefore_resolve
hook (link, link)