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 --helpto check the help, I found that thedevandbuildcommands 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 buildin this state, I get the following error:The help description for the
--configoption indevandbuildcommands says "Use specified config file (string)", but forroutesandrevealit says "Use specified Vite config file (string)".When I changed from
-c react-router.config.tsto-c vite.config.ts, it built correctly. However, the bottom of the help also shows:Should I pass
react-router.config.tsorvite.config.tsto the--configoption?Additional information: I looked at the code briefly, and it seems that
viteBuild()inpackages/react-router-dev/vite/build.tsexpects 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