Skip to content

Commit

Permalink
fix: use single alias for reused components on different paths
Browse files Browse the repository at this point in the history
  • Loading branch information
PindaPixel authored and posva committed Jan 4, 2024
1 parent 27a5897 commit 1544363
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/codegen/generateRouteRecords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ function generatePageImport(
if (mode === 'async') {
return `() => import('${filepath}')`
} else {
const existingEntries = importsMap.getImportList(filepath);
if (existingEntries.length) {
return existingEntries[0].as;
}
const importName = `_page_${importsMap.size}`
importsMap.addDefault(filepath, importName)
return importName
Expand Down

0 comments on commit 1544363

Please sign in to comment.