Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 71f193b

Browse files
committed
refactor(serer): clean up
1 parent 306c639 commit 71f193b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

server/app.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,14 @@ export class Application implements ServerApplication {
10271027
true
10281028
)
10291029

1030+
// add app/404 modules as shared entry
10301031
entryMods.set(Array.from(this.#modules.keys()).filter(url => ['/app', '/404'].includes(trimModuleExt(url))), true)
10311032

1033+
// add page module entries
1034+
this.#pageRouting.lookup(routes => {
1035+
routes.forEach(({ module: { url } }) => entryMods.set([url], false))
1036+
})
1037+
10321038
this.#modules.forEach(mod => {
10331039
mod.deps.forEach(({ url, isDynamic }) => {
10341040
if (isDynamic) {
@@ -1048,19 +1054,14 @@ export class Application implements ServerApplication {
10481054
})
10491055
})
10501056

1051-
// add page module entries
1052-
this.#pageRouting.lookup(routes => {
1053-
routes.forEach(({ module: { url } }) => entryMods.set([url], false))
1054-
})
1055-
10561057
refCounter.forEach((refers, url) => {
10571058
if (refers.size > 1) {
10581059
let shared = 0
10591060
for (const mods of entryMods.keys()) {
10601061
const some = mods.some(u => {
10611062
let scoped = false
10621063
this.lookupDeps(u, dep => {
1063-
if (!dep.isDynamic && refers.has(dep.url)) {
1064+
if (!dep.isDynamic && url === dep.url) {
10641065
scoped = true
10651066
return false
10661067
}

0 commit comments

Comments
 (0)