File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -164,10 +164,12 @@ var Project = function () {
164
164
if ( typeof configMethod . config == 'function' ) {
165
165
var userConfigObj = configMethod . config . call ( userConfig , options , this . cwd ) ;
166
166
167
- this . config . setExports ( userConfigObj . export ) ;
168
- this . config . setCompiler ( userConfigObj . modifyWebpackConfig ) ;
169
- this . config . setSync ( userConfigObj . sync ) ;
170
- this . setCommands ( userConfigObj . commands ) ;
167
+ if ( userConfigObj ) {
168
+ this . config . setExports ( userConfigObj . export ) ;
169
+ this . config . setCompiler ( userConfigObj . modifyWebpackConfig ) ;
170
+ this . config . setSync ( userConfigObj . sync ) ;
171
+ this . setCommands ( userConfigObj . commands ) ;
172
+ }
171
173
} else {
172
174
error ( this . configFile + ' 没有 exports 正确的方法!' ) ;
173
175
return this ;
Original file line number Diff line number Diff line change @@ -136,10 +136,12 @@ class Project {
136
136
if ( typeof configMethod . config == 'function' ) {
137
137
const userConfigObj = configMethod . config . call ( userConfig , options , this . cwd ) ;
138
138
139
- this . config . setExports ( userConfigObj . export ) ;
140
- this . config . setCompiler ( userConfigObj . modifyWebpackConfig ) ;
141
- this . config . setSync ( userConfigObj . sync ) ;
142
- this . setCommands ( userConfigObj . commands ) ;
139
+ if ( userConfigObj ) {
140
+ this . config . setExports ( userConfigObj . export ) ;
141
+ this . config . setCompiler ( userConfigObj . modifyWebpackConfig ) ;
142
+ this . config . setSync ( userConfigObj . sync ) ;
143
+ this . setCommands ( userConfigObj . commands ) ;
144
+ }
143
145
} else {
144
146
error ( this . configFile + ' 没有 exports 正确的方法!' ) ;
145
147
return this ;
You can’t perform that action at this time.
0 commit comments