-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
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
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
Used Package Manager
npm
Expected Behavior
This code console.log
s the Vite “mode” in both vite.config.ts
and routes.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 (and development
when doing dev server)
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.
wozozo