mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
Feat: add possiblity to mute webpack in non-dev modes (#2411)
Move webpackStats to nuxt.options Only clearConsole when we expect webpack to output stats
This commit is contained in:
parent
0f4bf0f9b2
commit
c92d427bb0
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user