File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -231,9 +231,11 @@ var Project = function () {
231
231
} ) ;
232
232
233
233
if ( ykitConfigFile && ykitConfigFile . config ) {
234
- extend ( true , this . config , ykitConfigFile . config ) ;
235
- handleExportsConfig . bind ( this ) ( ykitConfigFile . config ) ;
236
- this . setCommands ( ykitConfigFile . commands || ykitConfigFile . config . command ) ; // 后者兼容以前形式
234
+ var configFileConfig = typeof ykitConfigFile . config === 'function' ? ykitConfigFile . config ( ) : ykitConfigFile . config ;
235
+
236
+ extend ( true , this . config , configFileConfig ) ;
237
+ handleExportsConfig . bind ( this ) ( configFileConfig ) ;
238
+ this . setCommands ( ykitConfigFile . commands || configFileConfig . command ) ; // 后者兼容以前形式
237
239
this . setHooks ( ykitConfigFile . hooks ) ;
238
240
this . setProxy ( ykitConfigFile . proxy ) ;
239
241
this . setServer ( ykitConfigFile . server ) ;
Original file line number Diff line number Diff line change @@ -208,9 +208,13 @@ class Project {
208
208
} ) ;
209
209
210
210
if ( ykitConfigFile && ykitConfigFile . config ) {
211
- extend ( true , this . config , ykitConfigFile . config ) ;
212
- handleExportsConfig . bind ( this ) ( ykitConfigFile . config ) ;
213
- this . setCommands ( ykitConfigFile . commands || ykitConfigFile . config . command ) ; // 后者兼容以前形式
211
+ const configFileConfig = typeof ykitConfigFile . config === 'function'
212
+ ? ykitConfigFile . config ( )
213
+ : ykitConfigFile . config ;
214
+
215
+ extend ( true , this . config , configFileConfig ) ;
216
+ handleExportsConfig . bind ( this ) ( configFileConfig ) ;
217
+ this . setCommands ( ykitConfigFile . commands || configFileConfig . command ) ; // 后者兼容以前形式
214
218
this . setHooks ( ykitConfigFile . hooks ) ;
215
219
this . setProxy ( ykitConfigFile . proxy ) ;
216
220
this . setServer ( ykitConfigFile . server ) ;
You can’t perform that action at this time.
0 commit comments