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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy