Skip to content

Commit 80b5f15

Browse files
committed
Use a compact way to convert to a mutable array
1 parent d487ae0 commit 80b5f15

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/react-router-dev/vite/cloudflare-dev-proxy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ export const cloudflareDevProxyVitePlugin = <Env, Cf extends CfProperties>(
5151
// Vite v6 overrides the default resolve.conditions, so we have to import them
5252
// and if the export doesn't exist, it means that we're in Vite v5, so an empty array should be used
5353
// https://vite.dev/guide/migration.html#default-value-for-resolve-conditions
54-
const serverConditions =
55-
"defaultServerConditions" in vite ? vite.defaultServerConditions : [];
54+
const serverConditions: string[] =
55+
"defaultServerConditions" in vite
56+
? [...vite.defaultServerConditions]
57+
: [];
5658

5759
return {
5860
ssr: {

packages/react-router-dev/vite/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,11 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
744744
// https://vite.dev/guide/migration.html#default-value-for-resolve-conditions
745745
let viteClientConditions: string[] =
746746
"defaultClientConditions" in vite
747-
? Array.from(vite.defaultClientConditions)
747+
? [...vite.defaultClientConditions]
748748
: [];
749749
let viteServerConditions: string[] =
750750
"defaultServerConditions" in vite
751-
? Array.from(vite.defaultServerConditions)
751+
? [...vite.defaultServerConditions]
752752
: [];
753753

754754
logger = vite.createLogger(viteUserConfig.logLevel, {

0 commit comments

Comments
 (0)