From e016b5d1843830a9f848faf88b599da98df8043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 20 Jan 2017 18:55:30 +0100 Subject: [PATCH] Exit with code 1 on build error --- bin/nuxt-generate | 2 +- lib/build.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/nuxt-generate b/bin/nuxt-generate index 19c82bec2b..8feabf3c0c 100755 --- a/bin/nuxt-generate +++ b/bin/nuxt-generate @@ -27,5 +27,5 @@ nuxt.generate() }) .catch((err) => { console.error(err) // eslint-disable-line no-console - process.exit() + process.exit(1) }) diff --git a/lib/build.js b/lib/build.js index a170eafa00..3635e3526b 100644 --- a/lib/build.js +++ b/lib/build.js @@ -337,6 +337,7 @@ function webpackRunClient () { serverCompiler.run((err, stats) => { if (err) return reject(err) console.log('[nuxt:build:client]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console + if (stats.hasErrors()) return reject('Webpack build exited with errors') resolve() }) }) @@ -349,6 +350,7 @@ function webpackRunServer () { serverCompiler.run((err, stats) => { if (err) return reject(err) console.log('[nuxt:build:server]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console + if (stats.hasErrors()) return reject('Webpack build exited with errors') const bundlePath = join(serverConfig.output.path, serverConfig.output.filename) readFile(bundlePath, 'utf8') .then((bundle) => {