Skip to content

Commit

Permalink
fix: when the enableCustomEntry is set to true, the entry.tsx should …
Browse files Browse the repository at this point in the history
…be recognized first (#6420)
  • Loading branch information
caohuilin authored Oct 22, 2024
1 parent c686e60 commit 0c072d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/nine-turkeys-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/app-tools': patch
---

fix: when the enableCustomEntry is set to true, the `entry.tsx` should be recognized first.

fix: 开启 enableCustomEntry 后, `entry.tsx` 入口应优先被识别
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const scanDir = async (
const customEntryFile = hasEntry(dir);
const customServerEntry = hasServerEntry(dir);

if (indexFile && !customBootstrap) {
if (!enableCustomEntry && indexFile && !customBootstrap) {
return {
entryName,
isMainEntry: false,
Expand Down Expand Up @@ -97,6 +97,7 @@ const scanDir = async (
customEntry: enableCustomEntry ? Boolean(customEntryFile) : false,
};
}

if (enableCustomEntry && customEntryFile) {
return {
entryName,
Expand All @@ -108,6 +109,7 @@ const scanDir = async (
customEntry: Boolean(customEntryFile),
};
}

return false;
}),
).then(entries => entries.filter(Boolean) as Entrypoint[]);
Expand Down

0 comments on commit 0c072d8

Please sign in to comment.