Skip to content

Commit

Permalink
fix(cli-service): process the webpack failed hook in the serve command (
Browse files Browse the repository at this point in the history
#5542)

fixes #4891
  • Loading branch information
jeneser committed Jun 2, 2020
1 parent fa871b0 commit 36f961e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@vue/cli-service/lib/commands/serve.js
@@ -1,5 +1,6 @@
const {
info,
error,
hasProjectYarn,
hasProjectPnpm,
openBrowser,
Expand Down Expand Up @@ -161,6 +162,12 @@ module.exports = (api, options) => {
// create compiler
const compiler = webpack(webpackConfig)

// handle compiler error
compiler.hooks.failed.tap('vue-cli-service serve', msg => {
error(msg)
process.exit(1)
})

// create server
const server = new WebpackDevServer(compiler, Object.assign({
logLevel: 'silent',
Expand Down

0 comments on commit 36f961e

Please sign in to comment.