Skip to content

Commit

Permalink
fix(@react-router/dev): prevent argv parsing crash when optionnal arg…
Browse files Browse the repository at this point in the history
…s are passed to the cli (#12609)
  • Loading branch information
PhilDL authored Dec 21, 2024
1 parent 329fc0a commit ae9a92d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
- pavsoldatov
- pcattori
- petersendidit
- phildl
- pierophp
- printfn
- promet99
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dev/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let arg = require("arg");
// default `NODE_ENV` so React loads the proper version in it's CJS entry script.
// We have to do this before importing `run.ts` since that is what imports
// `react` (indirectly via `react-router`)
let args = arg({}, { argv: process.argv.slice(2) });
let args = arg({}, { argv: process.argv.slice(2), stopAtPositional: true });
if (args._[0] === "dev") {
process.env.NODE_ENV = process.env.NODE_ENV ?? "development";
} else {
Expand Down

0 comments on commit ae9a92d

Please sign in to comment.