Skip to content

Commit fff62f7

Browse files
committed
refactor: enable dev config in more cases
1 parent 327d041 commit fff62f7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/guide/mode-and-env.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ Loaded variables will become available to all `vue-cli-service` commands, plugin
2222

2323
An env file for a specific mode (e.g. `.env.production`) will take higher priority than a generic one (e.g. `.env`).
2424

25-
In addition, environment variables that already exist when Vue CLI is bootstrapped have the highest priority and will not be overwritten by `.env` files. If you have a default `NODE_ENV` in your environment, you might want to consider removing it.
25+
In addition, environment variables that already exist when Vue CLI is bootstrapped have the highest priority and will not be overwritten by `.env` files.
26+
:::
27+
28+
::: warning NODE_ENV
29+
If you have a default `NODE_ENV` in your environment, you should either remove it or explicitly set `NODE_ENV` when running `vue-cli-service` commands.
2630
:::
2731

2832
## Modes

packages/@vue/cli-service/lib/config/dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = (api, options) => {
22
api.chainWebpack(webpackConfig => {
3-
if (process.env.NODE_ENV === 'development') {
3+
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
44
webpackConfig
55
.devtool('cheap-module-eval-source-map')
66
.output

0 commit comments

Comments
 (0)