@@ -193,7 +193,7 @@ class Project {
193
193
// 运行插件模块
194
194
if ( module && module . config ) {
195
195
handleExportsConfig . bind ( this ) ( module . config , pluginItem . options ) ;
196
- this . setCommands ( module . commands || ykitConfigFile . config . command , pluginName ) ; // 后者兼容以前形式
196
+ this . setCommands ( module . commands , pluginName ) ; // 后者兼容以前形式
197
197
this . setHooks ( module . hooks ) ;
198
198
this . setBuild ( module . build ) ;
199
199
}
@@ -208,15 +208,16 @@ class Project {
208
208
} ) ;
209
209
210
210
if ( ykitConfigFile && ykitConfigFile . config ) {
211
- const configFileConfig = typeof ykitConfigFile . config === 'function'
211
+ const ykitJSConfig = typeof ykitConfigFile . config === 'function'
212
212
? ykitConfigFile . config ( )
213
213
: ykitConfigFile . config ;
214
214
215
- extend ( true , this . config , configFileConfig ) ;
215
+ extend ( true , this . config , ykitJSConfig ) ;
216
216
handleCommonsChunk . bind ( this ) ( this . config ) ;
217
- handleExportsConfig . bind ( this ) ( configFileConfig ) ;
217
+ handleExportsConfig . bind ( this ) ( ykitJSConfig ) ;
218
218
219
- this . setCommands ( ykitConfigFile . commands || configFileConfig . command ) ; // 后者兼容以前形式
219
+ const cmds = ykitConfigFile . commands || ykitJSConfig . command || ykitJSConfig . commands ; // 后者兼容以前形式
220
+ this . setCommands ( cmds ) ;
220
221
this . setHooks ( ykitConfigFile . hooks ) ;
221
222
this . setProxy ( ykitConfigFile . proxy ) ;
222
223
this . setServer ( ykitConfigFile . server ) ;
0 commit comments