Skip to content

Commit

Permalink
fix: context passed in is not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Jun 27, 2024
1 parent 3909556 commit ef6b53d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions crates/rspack_core/src/compiler/make/repair/factorize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ impl Task<MakeTaskContext> for FactorizeTask {
let dependency = self.dependency;
// let dep_id = *dependency.id();

let context = if let Some(context) = dependency.get_context() {
let context = if let Some(context) = dependency.get_context()
&& !context.is_empty()
{
context
} else if let Some(context) = &self.original_module_context {
} else if let Some(context) = &self.original_module_context
&& !context.is_empty()
{
context
} else {
&self.options.context
Expand Down
1 change: 0 additions & 1 deletion crates/rspack_core/src/normal_module_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ impl NormalModuleFactory {
let resource_data = if scheme.is_some() {
// resource with scheme
let mut resource_data = ResourceData::new(unresolved_resource.to_owned(), "".into());
// resource with scheme
plugin_driver
.normal_module_factory_hooks
.resolve_for_scheme
Expand Down

0 comments on commit ef6b53d

Please sign in to comment.