File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
packages/@vue/cli-service/lib Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -163,17 +163,19 @@ module.exports = class Service {
163163 process . env . VUE_CLI_SERVICE_CONFIG_PATH ||
164164 path . resolve ( this . context , 'vue.config.js' )
165165 )
166- try {
167- fileConfig = require ( configPath )
168- if ( ! fileConfig || typeof fileConfig !== 'object' ) {
169- error (
170- `Error loading ${ chalk . bold ( 'vue.config.js' ) } : should export an object.`
171- )
172- fileConfig = null
166+ if ( fs . existsSync ( configPath ) ) {
167+ try {
168+ fileConfig = require ( configPath )
169+ if ( ! fileConfig || typeof fileConfig !== 'object' ) {
170+ error (
171+ `Error loading ${ chalk . bold ( 'vue.config.js' ) } : should export an object.`
172+ )
173+ fileConfig = null
174+ }
175+ } catch ( e ) {
176+ error ( `Error loading ${ chalk . bold ( 'vue.config.js' ) } :` )
177+ throw e
173178 }
174- } catch ( e ) {
175- error ( `Error loading ${ chalk . bold ( 'vue.config.js' ) } :` )
176- throw e
177179 }
178180
179181 // package.vue
You can’t perform that action at this time.
0 commit comments