Skip to content

Commit

Permalink
fix(core): use resource shouldn't contain query
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Sep 16, 2024
1 parent 6f17ffa commit 3e46638
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/rspack_core/src/normal_module_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ impl NormalModuleFactory {
ModuleRuleUse::Array(array_use) => Cow::Borrowed(array_use),
ModuleRuleUse::Func(func_use) => {
let context = FuncUseCtx {
resource: Some(resource_data.resource.clone()),
// align with webpack https://github.com/webpack/webpack/blob/899f06934391baede59da3dcd35b5ef51c675dbe/lib/NormalModuleFactory.js#L576
// resource shouldn't contain query otherwise it will cause duplicate query in https://github.com/unjs/unplugin/blob/62fdc5ae361d86a6ec39eaef5d8f01e12c6a794d/src/utils.ts#L58
resource: resource_data.resource_path.clone().map(|x| x.to_string()),
real_resource: Some(user_request.clone()),
issuer: data.issuer.clone(),
resource_query: resource_data.resource_query.clone(),
Expand Down

0 comments on commit 3e46638

Please sign in to comment.