Skip to content

Commit

Permalink
feat(config): detect vue.config.js call error (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexXuan committed Sep 11, 2021
1 parent f7097c2 commit 41a0e62
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ let vueConfig: VueCliOptions = {}
try {
vueConfig = require(resolve(process.env.CLI_CONFIG_FILE || 'vue.config.js')) || {}
} catch (e) {
if (process.env.VITE_DEBUG) {
console.error(chalk.redBright(e))
// handle no vue.config.js
if (e.code === 'MODULE_NOT_FOUND') {
if (process.env.VITE_DEBUG) {
console.error(chalk.redBright(e))
}
} else {
console.error(chalk.redBright(e.stack ?? e))
}
}

Expand Down

0 comments on commit 41a0e62

Please sign in to comment.