diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 3b244dd1f0..832b5fd0a4 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -39,17 +39,7 @@ module.exports = class Builder { this.customFilesWatcher = null // Mute stats on dev - this.webpackStats = this.options.dev ? false : { - chunks: false, - children: false, - modules: false, - colors: true, - excludeAssets: [ - /.map$/, - /index\..+\.html$/, - /vue-ssr-client-manifest.json/ - ] - } + this.webpackStats = this.options.dev ? false : this.options.build.stats // Helper to resolve build paths this.relativeToBuild = (...args) => relativeTo(this.options.buildDir, ...args) diff --git a/lib/builder/webpack/client.config.js b/lib/builder/webpack/client.config.js index 88c815e22d..6d975b73c4 100644 --- a/lib/builder/webpack/client.config.js +++ b/lib/builder/webpack/client.config.js @@ -106,8 +106,11 @@ module.exports = function webpackClientConfig() { })) } + const shouldClearConsole = this.options.build.stats !== false && + this.options.build.stats !== 'errors-only' + // Add friendly error plugin - config.plugins.push(new FriendlyErrorsWebpackPlugin()) + config.plugins.push(new FriendlyErrorsWebpackPlugin({ clearConsole: shouldClearConsole })) // -------------------------------------- // Dev specific config diff --git a/lib/common/options.js b/lib/common/options.js index 27e3df7dfa..f1433ec302 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -228,7 +228,18 @@ Options.defaults = { templates: [], watch: [], devMiddleware: {}, - hotMiddleware: {} + hotMiddleware: {}, + stats: { + chunks: false, + children: false, + modules: false, + colors: true, + excludeAssets: [ + /.map$/, + /index\..+\.html$/, + /vue-ssr-client-manifest.json/ + ] + } }, generate: { dir: 'dist',