Skip to content

Commit

Permalink
fix(@vue/cli-service): don't swallow vue.config.js errors (close vuej…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvfritz committed Feb 26, 2018
1 parent 92ddd09 commit 7cdded3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/lib/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ module.exports = class Service {
process.env.VUE_CLI_SERVICE_CONFIG_PATH ||
path.resolve(this.context, 'vue.config.js')
)
try {
if (fs.existsSync(configPath)) {
fileConfig = require(configPath)
if (!fileConfig || typeof fileConfig !== 'object') {
error(
`Error loading ${chalk.bold('vue.config.js')}: should export an object.`
)
fileConfig = null
}
} catch (e) {}
}

// package.vue
pkgConfig = this.pkg.vue
Expand Down

0 comments on commit 7cdded3

Please sign in to comment.