We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
framework
Example repo: https://github.com/fionawhim/rr-mode-bug
(this is based off of create-react-router)
create-react-router
npm install
npm run build -- --mode=staging
System: OS: macOS 14.7.1 CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz Memory: 60.05 MB / 16.00 GB Shell: 3.7.1 - /usr/local/bin/fish Binaries: Node: 18.16.0 - ~/.asdf/installs/nodejs/lts-hydrogen/bin/node npm: 9.5.1 - ~/.asdf/plugins/nodejs/shims/npm Browsers: Chrome: 131.0.6778.109 Safari: 18.1.1 npmPackages: @react-router/dev: ^7.0.2 => 7.0.2 @react-router/node: ^7.0.2 => 7.0.2 @react-router/serve: ^7.0.2 => 7.0.2 react-router: ^7.0.2 => 7.0.2 vite: ^5.4.11 => 5.4.11
npm
This code console.logs the Vite “mode” in both vite.config.ts and routes.ts.
console.log
vite.config.ts
routes.ts
The --mode set on the command line should be echoed in both places. In this case, each should say “staging”
--mode
Instead, the Vite mode for routes.ts is always production when doing a build (and development when doing dev server)
production
development
MODE FOR VITE CONFIG staging MODE FOR ROUTES: production MODE FOR VITE CONFIG staging
The rational here is to have routes that are generated in our staging environment but not our production environment.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using React Router as a...
framework
Reproduction
Example repo: https://github.com/fionawhim/rr-mode-bug
(this is based off of
create-react-router
)npm install
, &c.npm run build -- --mode=staging
System Info
Used Package Manager
npm
Expected Behavior
This code
console.log
s the Vite “mode” in bothvite.config.ts
androutes.ts
.The
--mode
set on the command line should be echoed in both places. In this case, each should say “staging”Actual Behavior
Instead, the Vite mode for routes.ts is always
production
when doing a build (anddevelopment
when doing dev server)The rational here is to have routes that are generated in our staging environment but not our production environment.
The text was updated successfully, but these errors were encountered: