Skip to content

Commit

Permalink
chore: correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript authored May 16, 2024
1 parent 48c563b commit c40ecf7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ async function getRouteChunkFilesMap(
// skip entry chunk
if (chunk.entry) continue;

// skip illegal absPath route
if (!route.absPath?.startsWith('/')) {
logger.error(
`[routePreloadOnLoad]: route absPath error, cannot preload for ${route.absPath}`,
);
continue;
}

// pick js and css files
const pickedFiles = pickPreloadFiles(chunk.files!);
const routeOrigins = chunk.origins!.filter((origin) =>
Expand Down Expand Up @@ -161,6 +153,14 @@ async function getRoutePathFilesMap(
// skip redirect route
if (!route.file) continue;

// skip illegal absPath route
if (!route.absPath?.startsWith('/')) {
logger.error(
`[routePreloadOnLoad]: route absPath error, cannot preload for ${route.absPath}`,
);
continue;
}

let current: IRoute | undefined = route;
const files: string[] = [];

Expand Down

0 comments on commit c40ecf7

Please sign in to comment.