File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,19 @@ var Project = function () {
154
154
}
155
155
156
156
// 通过插件扩展配置
157
- _this3 . plugins . map ( function ( pluginName ) {
157
+ _this3 . plugins . map ( function ( pluginItem ) {
158
+ var pluginName = '' ;
159
+
160
+ if ( typeof pluginItem === 'string' ) {
161
+ pluginName = pluginItem ;
162
+ } else if ( ( typeof pluginItem === 'undefined' ? 'undefined' : _typeof ( pluginItem ) ) === 'object' ) {
163
+ pluginName = pluginItem . plugin ? pluginItem . plugin : '' ;
164
+ _typeof ( pluginItem . options ) === 'object' && extend ( options , pluginItem . options ) ;
165
+ } else {
166
+ error ( '插件配置有误,请检查 ykit.js' ) ;
167
+ process . exit ( 1 ) ;
168
+ }
169
+
158
170
if ( pluginName . indexOf ( ykitConfigStartWith ) === - 1 ) {
159
171
pluginName = ykitConfigStartWith + pluginName ;
160
172
}
Original file line number Diff line number Diff line change @@ -138,7 +138,19 @@ class Project {
138
138
}
139
139
140
140
// 通过插件扩展配置
141
- this . plugins . map ( ( pluginName ) => {
141
+ this . plugins . map ( ( pluginItem ) => {
142
+ let pluginName = '' ;
143
+
144
+ if ( typeof pluginItem === 'string' ) {
145
+ pluginName = pluginItem ;
146
+ } else if ( typeof pluginItem === 'object' ) {
147
+ pluginName = pluginItem . plugin ? pluginItem . plugin : '' ;
148
+ typeof pluginItem . options === 'object' && extend ( options , pluginItem . options ) ;
149
+ } else {
150
+ error ( '插件配置有误,请检查 ykit.js' ) ;
151
+ process . exit ( 1 ) ;
152
+ }
153
+
142
154
if ( pluginName . indexOf ( ykitConfigStartWith ) === - 1 ) {
143
155
pluginName = ykitConfigStartWith + pluginName ;
144
156
}
You can’t perform that action at this time.
0 commit comments