File tree 2 files changed +7
-2
lines changed
packages/react-router-dev
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @react-router/dev " : patch
3
+ ---
4
+
5
+ Fix CLI parsing to allow argumentless ` npx react-router ` usage
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ let arg = require("arg");
5
5
// default `NODE_ENV` so React loads the proper version in it's CJS entry script.
6
6
// We have to do this before importing `run.ts` since that is what imports
7
7
// `react` (indirectly via `react-router`)
8
- let args = arg ( { } , { argv : process . argv . slice ( 2 ) , stopAtPositional : true } ) ;
9
- if ( args . _ [ 0 ] === "dev" ) {
8
+ let args = arg ( { } , { argv : process . argv . slice ( 2 ) , permissive : true } ) ;
9
+ if ( args . _ . length === 0 || args . _ [ 0 ] === "dev" ) {
10
10
process . env . NODE_ENV = process . env . NODE_ENV ?? "development" ;
11
11
} else {
12
12
process . env . NODE_ENV = process . env . NODE_ENV ?? "production" ;
You can’t perform that action at this time.
0 commit comments