File tree 2 files changed +6
-4
lines changed
packages/@vue/cli-service/lib
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,12 @@ module.exports = class Service {
53
53
this . initialized = true
54
54
this . mode = mode
55
55
56
- // load base .env
57
- this . loadEnv ( )
58
56
// load mode .env
59
57
if ( mode ) {
60
58
this . loadEnv ( mode )
61
59
}
60
+ // load base .env
61
+ this . loadEnv ( )
62
62
63
63
// load user config
64
64
const userOptions = this . loadUserOptions ( )
@@ -106,8 +106,8 @@ module.exports = class Service {
106
106
}
107
107
}
108
108
109
- load ( basePath )
110
109
load ( localPath )
110
+ load ( basePath )
111
111
}
112
112
113
113
resolvePlugins ( inlinePlugins , useBuiltIn ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ const fs = require('fs')
3
3
module . exports = function loadEnv ( path = '.env' ) {
4
4
const config = parse ( fs . readFileSync ( path , 'utf-8' ) )
5
5
Object . keys ( config ) . forEach ( key => {
6
- process . env [ key ] = config [ key ]
6
+ if ( typeof process . env [ key ] === 'undefined' ) {
7
+ process . env [ key ] = config [ key ]
8
+ }
7
9
} )
8
10
return config
9
11
}
You can’t perform that action at this time.
0 commit comments