Confused about the value to pass to CLI's --config option #14288
Unanswered
kyokota-bj
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm considering using React Router (v7.7.1) in framework mode.
I set up a development environment following the Installation documentation.
When I ran
npx react-router --help
to check the help, I found that thedev
andbuild
commands support the-c(--config)
option, so I tried modifying my npm scripts as follows:※ This is because I want to change and move the configuration file.
When I run
npm run build
in this state, I get the following error:The help description for the
--config
option indev
andbuild
commands says "Use specified config file (string)", but forroutes
andreveal
it says "Use specified Vite config file (string)".When I changed from
-c react-router.config.ts
to-c vite.config.ts
, it built correctly. However, the bottom of the help also shows:Should I pass
react-router.config.ts
orvite.config.ts
to the--config
option?Additional information: I looked at the code briefly, and it seems that
viteBuild()
inpackages/react-router-dev/vite/build.ts
expects a path tovite.config.ts
, but it appears that the --config value is passed directly to it.Beta Was this translation helpful? Give feedback.
All reactions