Skip to content

Commit 28cf50a

Browse files
fix: should render correctly for rsc projects in the Windows system (web-infra-dev#8332)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd29c98 commit 28cf50a

12 files changed

Lines changed: 254 additions & 279 deletions

File tree

.changeset/tidy-parks-swim.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modern-js/app-tools': patch
3+
'@modern-js/builder': patch
4+
---
5+
6+
fix: should support windows path in server-entry route pattern
7+
fix: route pattern 中应该支持 windows 系统路径

packages/cli/builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"dependencies": {
3535
"@modern-js/utils": "workspace:*",
36-
"@rsbuild/core": "2.0.0-beta.2",
36+
"@rsbuild/core": "2.0.0-beta.4",
3737
"@rsbuild/plugin-assets-retry": "1.5.1",
3838
"@rsbuild/plugin-check-syntax": "1.6.1",
3939
"@rsbuild/plugin-css-minimizer": "1.1.1",

packages/cli/builder/src/plugins/rscConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ export function pluginRscConfig(): RsbuildPlugin {
6060
// Matches: layout.tsx, layout.ts, layout.jsx, layout.js
6161
// page.tsx, page.ts, page.jsx, page.js
6262
// $.tsx, $.ts, $.jsx, $.js
63+
// Use [/\\] before filename so both Unix (/) and Windows (\) paths match
6364
const routeFilePattern =
64-
/routes[/\\].*\/(layout|page|\$)\.[tj]sx?$/;
65+
/routes[/\\].*[/\\](layout|page|\$)\.[tj]sx?$/;
6566

6667
// Pattern 2: Match App.[tj]sx files anywhere (self-controlled routing)
6768
// Matches: App.tsx, App.ts, App.jsx, App.js in any directory

0 commit comments

Comments
 (0)