File tree 4 files changed +24
-0
lines changed
4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @react-router/dev " : patch
3
+ ---
4
+
5
+ Properly initialize ` NODE_ENV ` if not already set for compatibility with React 19
Original file line number Diff line number Diff line change 147
147
- johnpangalos
148
148
- jonkoops
149
149
- jrakotoharisoa
150
+ - jrestall
150
151
- juanpprieto
151
152
- jungwoo3490
152
153
- kachun333
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
+ let arg = require ( "arg" ) ;
3
+
4
+ // Minimal replication of our actual parsing in `run.ts`. If not already set,
5
+ // default `NODE_ENV` so React loads the proper version in it's CJS entry script.
6
+ // We have to do this before importing `run.ts` since that is what imports
7
+ // `react` (indirectly via `react-router`)
8
+ let args = arg ( { } , { argv : process . argv . slice ( 2 ) } ) ;
9
+ if ( args . _ [ 0 ] === "dev" ) {
10
+ process . env . NODE_ENV = process . env . NODE_ENV ?? "development" ;
11
+ } else {
12
+ process . env . NODE_ENV = process . env . NODE_ENV ?? "production" ;
13
+ }
14
+
2
15
require ( "./dist/cli/index" ) ;
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
+
3
+ // If not already set, default `NODE_ENV=production` so React loads the proper
4
+ // version in it's CJS entry script
5
+ process . env . NODE_ENV = process . env . NODE_ENV ?? "production" ;
6
+
2
7
require ( "./dist/cli" ) ;
You can’t perform that action at this time.
0 commit comments