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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix wrong context in external function #3372

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented Jun 1, 2023

Related issue (if exists)

Summary

馃 Generated by Copilot at 4c6cea2

This pull request adds a context field to the structs and arguments that are used for module creation and plugin application. This allows plugins to resolve external dependencies based on the directory where the module request originated from.

Walkthrough

馃 Generated by Copilot at 4c6cea2

  • Add context field to NormalModuleFactoryCreateData and PluginArgs structs to pass the module request origin directory to the NormalModuleFactory and the plugins (link, link)
  • Use context field from PluginArgs to resolve external dependencies with custom functions instead of deriving it from the request string, and panic if context is None in crates/rspack_plugin_externals/src/plugin.rs (link)
  • Move use std::fmt::Debug statement from crates/rspack_plugin_externals/src/plugin.rs to crates/rspack_core/src/normal_module_factory.rs where it is needed for the ExternalItemFnCtx struct (link)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

Test Compatibility Diff

@hardfist hardfist enabled auto-merge June 1, 2023 02:45
@hardfist hardfist added this pull request to the merge queue Jun 1, 2023
Merged via the queue into main with commit 691a822 Jun 1, 2023
20 checks passed
@hardfist hardfist deleted the fix-rust-check branch June 1, 2023 03:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants