Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Oct 25, 2023
1 parent e71a1e6 commit 2cbf9d6
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions packages/rspack/src/loader-runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,8 @@ function createLoaderObject(loader: any, compiler: Compiler): LoaderObject {
obj.path = splittedRequest.path;
obj.query = splittedRequest.query;
obj.fragment = splittedRequest.fragment;

if (obj.query.startsWith("??")) {
const ident = obj.query.slice(2);
if (ident === "[[missing ident]]") {
throw new Error(
"No ident is provided by referenced loader. " +
"When using a function for Rule.use in config you need to " +
"provide an 'ident' property for referenced loader options."
);
}
obj.options = compiler.ruleSet.references.get(ident);
if (obj.options === undefined) {
throw new Error("Invalid ident is provided by referenced loader");
}
obj.ident = ident;
} else {
obj.options = undefined;
obj.ident = undefined;
}
obj.options = undefined;
obj.ident = undefined;
} else {
if (!value.loader)
throw new Error(
Expand Down

0 comments on commit 2cbf9d6

Please sign in to comment.