File tree 2 files changed +15
-6
lines changed 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
node_modules /
2
+ * .swp
Original file line number Diff line number Diff line change @@ -13,18 +13,26 @@ function getBabelTarget(envConfig) {
13
13
return unknown ? "6.10" : current . replace ( / ^ n o d e j s / , "" ) ;
14
14
}
15
15
16
- function webpackConfig ( dir , additionalConfig ) {
17
- var config = conf . load ( ) ;
16
+ function loadEnvironment ( config ) {
18
17
var envConfig = config . build . environment || config . build . Environment || { } ;
19
- var context = (
18
+ var contextConfig = (
20
19
process . env . CONTEXT &&
21
20
config . context &&
22
21
config . context [ process . env . CONTEXT ] &&
23
22
( config . context [ process . env . CONTEXT ] . environment || config . context [ process . env . CONTEXT ] . Environment )
24
23
) || { } ;
25
- Object . keys ( context ) . forEach ( key => {
26
- envConfig [ key ] = context [ key ] ;
27
- } ) ;
24
+ var branchConfig = (
25
+ process . env . BRANCH &&
26
+ config . context &&
27
+ config . context [ process . env . BRANCH ] &&
28
+ ( config . context [ process . env . BRANCH ] . environment || config . context [ process . env . BRANCH ] . Environment )
29
+ ) || { } ;
30
+ return merge ( envConfig , contextConfig , branchConfig ) ;
31
+ }
32
+
33
+ function webpackConfig ( dir , additionalConfig ) {
34
+ var config = conf . load ( ) ;
35
+ var envConfig = loadEnvironment ( config ) ;
28
36
var babelOpts = { cacheDirectory : true } ;
29
37
if ( ! fs . existsSync ( path . join ( process . cwd ( ) , ".babelrc" ) ) ) {
30
38
babelOpts . presets = [
You can’t perform that action at this time.
0 commit comments