Skip to content

Commit 1a41e55

Browse files
authored
feat: support React Router 7 in react-refresh rules (#652)
1 parent de2d48d commit 1a41e55

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/configs/react.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ const RemixPackages = [
1515
'@remix-run/serve',
1616
'@remix-run/dev',
1717
]
18+
const ReactRouterPackages = [
19+
'@react-router/node',
20+
'@react-router/react',
21+
'@react-router/serve',
22+
'@react-router/dev',
23+
]
1824
const NextJsPackages = [
1925
'next',
2026
]
@@ -57,6 +63,7 @@ export async function react(
5763

5864
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(i => isPackageExists(i))
5965
const isUsingRemix = RemixPackages.some(i => isPackageExists(i))
66+
const isUsingReactRouter = ReactRouterPackages.some(i => isPackageExists(i))
6067
const isUsingNext = NextJsPackages.some(i => isPackageExists(i))
6168

6269
const plugins = pluginReact.configs.all.plugins
@@ -125,7 +132,7 @@ export async function react(
125132
'generateViewport',
126133
]
127134
: []),
128-
...(isUsingRemix
135+
...(isUsingRemix || isUsingReactRouter
129136
? [
130137
'meta',
131138
'links',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy