[Bug]: --env-mode
can‘t change the process.env.NODE_ENV
environment variable.
#2904
Labels
🐞 bug
Something isn't working
Version
Browsers: Chrome: 126.0.6478.127 Edge: Chromium (126.0.2592.87) npmPackages: @rsbuild/core: 1.0.0-alpha.9 => 1.0.0-alpha.9
Details
Suppose there is a
.env.development
file in the project with the following content:When you run:
process.env.NODE_ENV
will be set toproduction
instead ofdevelopment
.However, when using webpack or Vite,
process.env.NODE_ENV
is correctly set.For example:
With the same
.env.development
file, run:In these cases,
process.env.NODE_ENV
is always correctly set todevelopment
.Reproduce link
unnecessary
Reproduce Steps
rsbuild build --env-mode development
The text was updated successfully, but these errors were encountered: