diff --git a/packages/rspack/src/loader-runner/index.ts b/packages/rspack/src/loader-runner/index.ts index 64b9cfcf957..e434ba70b91 100644 --- a/packages/rspack/src/loader-runner/index.ts +++ b/packages/rspack/src/loader-runner/index.ts @@ -78,10 +78,10 @@ function createLoaderObject( obj.query.replace(/#/g, "\u200b#") + obj.fragment, set: value => { - var splittedRequest = parseResourceWithoutFragment(value.request); + const splittedRequest = parseResourceWithoutFragment(value.request); obj.path = splittedRequest.path; obj.query = splittedRequest.query; - obj.fragment = splittedRequest.fragment || ""; + obj.fragment = ""; obj.options = obj.options === null ? splittedRequest.query