Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Dec 27, 2024
1 parent c89464b commit 638a47e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,9 @@ const composeBundlelessExternalConfig = (
resolver = (await getResolve()) as RspackResolver;
}

async function redirectPath(request: string): Promise<string | undefined> {
async function redirectPath(
request: string,
): Promise<string | undefined> {
try {
let resolvedRequest = request;
// use resolver to resolve the request
Expand Down Expand Up @@ -1063,9 +1065,9 @@ const composeBundlelessExternalConfig = (

if (jsRedirectPath) {
const redirectedPath = await redirectPath(resolvedRequest);
if(redirectedPath === undefined) {
if (redirectedPath === undefined) {
return callback(undefined, request);
}
}
resolvedRequest = redirectedPath;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/css/cssConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ export async function cssExternalHandler(
const redirectedPath = await redirectPath(request);
if (redirectedPath === undefined) {
return callback(undefined, request);
}
}
resolvedRequest = redirectedPath;
}

if(!isCssFile(resolvedRequest)) {
if (!isCssFile(resolvedRequest)) {
return false;
}

Expand All @@ -123,7 +123,7 @@ export async function cssExternalHandler(
);
}
return callback(undefined, resolvedRequest.replace(/\.[^.]+$/, '.css'));
}
}

return callback(undefined, request);
}
Expand Down

0 comments on commit 638a47e

Please sign in to comment.