File tree Expand file tree Collapse file tree
packages/react-router-dev Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { test , expect } from "@playwright/test" ;
2- import glob from "glob " ;
2+ import * as fs from "node:fs " ;
33
44import { build , createProject , reactRouterConfig } from "./helpers/vite.js" ;
55
@@ -8,9 +8,7 @@ const js = String.raw;
88test ( "ignores external server environments without skipping React Router build hooks" , async ( ) => {
99 let cwd = await createProject (
1010 {
11- "react-router.config.ts" : reactRouterConfig ( {
12- future : { v8_viteEnvironmentApi : true } ,
13- } ) ,
11+ "react-router.config.ts" : reactRouterConfig ( ) ,
1412 "vite.config.ts" : js `
1513 import { defineConfig } from "vite";
1614 import { reactRouter } from "@react-router/dev/vite";
@@ -104,12 +102,17 @@ test("ignores external server environments without skipping React Router build h
104102 };
105103 ` ,
106104 } ,
107- "vite-6 -template" ,
105+ "vite-7 -template" ,
108106 ) ;
109107
110108 let { status, stderr } = build ( { cwd } ) ;
111109
112110 expect ( stderr . toString ( ) . trim ( ) ) . toBeFalsy ( ) ;
113111 expect ( status ) . toBe ( 0 ) ;
114- expect ( glob . sync ( "build/client/assets/test-*.txt" , { cwd } ) . length ) . toBe ( 1 ) ;
112+ expect (
113+ fs
114+ . readdirSync ( "build/client/assets" )
115+ . filter ( ( file ) => file . startsWith ( "test-" ) && file . endsWith ( ".txt" ) )
116+ . length ,
117+ ) . toBe ( 1 ) ;
115118} ) ;
Original file line number Diff line number Diff line change @@ -438,14 +438,12 @@ async function resolveConfig({
438438 reactRouterConfigFile,
439439 skipRoutes,
440440 validateConfig,
441- shouldLogFutureFlagWarnings,
442441} : {
443442 root : string ;
444443 viteRunnerContext : ViteRunner . Context ;
445444 reactRouterConfigFile ?: string ;
446445 skipRoutes ?: boolean ;
447446 validateConfig ?: ValidateConfigFunction ;
448- shouldLogFutureFlagWarnings ?: boolean ;
449447} ) : Promise < ConfigResult > {
450448 let reactRouterUserConfig : ReactRouterConfig = { } ;
451449
@@ -798,14 +796,12 @@ export async function createConfigLoader({
798796 mode,
799797 skipRoutes,
800798 validateConfig,
801- shouldLogFutureFlagWarnings,
802799} : {
803800 watch : boolean ;
804801 rootDirectory ?: string ;
805802 mode : string ;
806803 skipRoutes ?: boolean ;
807804 validateConfig ?: ValidateConfigFunction ;
808- shouldLogFutureFlagWarnings ?: boolean ;
809805} ) : Promise < ConfigLoader > {
810806 root = Path . normalize ( root ?? process . env . REACT_ROUTER_ROOT ?? process . cwd ( ) ) ;
811807
@@ -836,14 +832,13 @@ export async function createConfigLoader({
836832 reactRouterConfigFile,
837833 skipRoutes,
838834 validateConfig,
839- shouldLogFutureFlagWarnings,
840835 } ) ;
841836
842837 let appDirectory : string ;
843838
844839 let initialConfigResult = await resolveConfig ( {
845840 root,
846- viteNodeContext ,
841+ viteRunnerContext ,
847842 reactRouterConfigFile,
848843 skipRoutes,
849844 validateConfig,
Original file line number Diff line number Diff line change @@ -1259,8 +1259,6 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
12591259 rootDirectory,
12601260 mode,
12611261 watch : viteCommand === "serve" ,
1262- shouldLogFutureFlagWarnings :
1263- viteCommand !== "build" || viteConfigEnv . isSsrBuild === true ,
12641262 } ) ;
12651263
12661264 await updatePluginContext ( ) ;
You can’t perform that action at this time.
0 commit comments