Skip to content

Commit 5269eac

Browse files
fix: RSC routes pattern and head exports (#8374)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9f59690 commit 5269eac

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function pluginRscConfig(): RsbuildPlugin {
6262
// $.tsx, $.ts, $.jsx, $.js
6363
// Use [/\\] before filename so both Unix (/) and Windows (\) paths match
6464
const routeFilePattern =
65-
/routes[/\\].*[/\\](layout|page|\$)\.[tj]sx?$/;
65+
/[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.[tj]sx?$/;
6666

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

packages/runtime/plugin-runtime/src/cli/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ export const runtimePlugin = (params?: {
8686
globalVars: {
8787
'process.env.IS_REACT18': process.env.IS_REACT18,
8888
},
89+
include: [
90+
new RegExp(
91+
`[\\\\/]node_modules[\\\\/]@${metaName}[\\\\/]runtime[\\\\/].*[\\\\/]head\\.[jt]sx?$`,
92+
),
93+
],
8994
},
9095
tools: {
9196
bundlerChain: chain => {
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
'use client';
12
import head from 'react-helmet';
23

34
export default head;
45

5-
export * from 'react-helmet';
6+
export { Helmet } from 'react-helmet';
7+
export type {
8+
HelmetTags,
9+
HelmetProps,
10+
HelmetPropsToState,
11+
HelmetData,
12+
HelmetDatum,
13+
HelmetHTMLBodyDatum,
14+
HelmetHTMLElementDatum,
15+
} from 'react-helmet';

0 commit comments

Comments
 (0)