Skip to content

Commit 5c56949

Browse files
authored
fix: should only watch file-based routes changes (#3742)
* fix: should only watch file-based routes * docs: change changeset
1 parent 8b7c6d4 commit 5c56949

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/sour-cobras-cheat.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modern-js/app-tools': patch
3+
---
4+
5+
fix: should only watch file-based routes changes
6+
fix: 只有基于文件的路由(约定式路由)需要被监听变化

packages/solutions/app-tools/src/analyze/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ export default ({
113113

114114
pagesDir = entrypoints
115115
.map(point => point.entry)
116-
.filter(Boolean)
116+
// should only watch file-based routes
117+
.filter(entry => entry && !path.extname(entry))
117118
.concat(nestedRouteEntries);
118119

119120
originEntrypoints = cloneDeep(entrypoints);

0 commit comments

Comments
 (0)