@@ -104,6 +104,11 @@ var Project = function () {
104
104
value : function setServer ( server ) {
105
105
this . server = server || { } ;
106
106
}
107
+ } , {
108
+ key : 'setBuild' ,
109
+ value : function setBuild ( build ) {
110
+ this . build = extend ( true , this . build , build ) ;
111
+ }
107
112
} , {
108
113
key : 'readConfig' ,
109
114
value : function readConfig ( ) {
@@ -196,6 +201,7 @@ var Project = function () {
196
201
handleExportsConfig . bind ( _this2 ) ( _module . config , pluginItem . options ) ;
197
202
_this2 . setCommands ( _module . commands || ykitConfigFile . config . command , pluginName ) ; // 后者兼容以前形式
198
203
_this2 . setHooks ( _module . hooks ) ;
204
+ _this2 . setBuild ( _module . build ) ;
199
205
}
200
206
201
207
// 扩展 eslint 配置
@@ -214,6 +220,7 @@ var Project = function () {
214
220
this . setHooks ( ykitConfigFile . hooks ) ;
215
221
this . setProxy ( ykitConfigFile . proxy ) ;
216
222
this . setServer ( ykitConfigFile . server ) ;
223
+ this . setBuild ( ykitConfigFile . build ) ;
217
224
} else {
218
225
logError ( 'Local ' + this . configFile + ' config not found.' ) ;
219
226
logDoc ( 'http://ued.qunar.com/ykit/docs-配置.html' ) ;
@@ -436,7 +443,7 @@ var Project = function () {
436
443
cc . enqueue ( {
437
444
opt : opt ,
438
445
cwd : cwd ,
439
- buildOpts : _this4 . config . build || { } ,
446
+ buildOpts : _this4 . build || _this4 . config . build || { } ,
440
447
assetName : asset . name
441
448
} , function ( err , response ) {
442
449
if ( response . error ) {
0 commit comments