mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
hide fancy errors during test
This commit is contained in:
parent
42a23f98d1
commit
1ee08ad101
@ -40,6 +40,7 @@ export default class Builder {
|
||||
this.filesWatcher = null
|
||||
this.customFilesWatcher = null
|
||||
this.spinner = createSpinner()
|
||||
this.spinner.enabled = !this.options.test
|
||||
|
||||
// Mute stats on dev
|
||||
this.webpackStats = this.options.dev ? false : this.options.build.stats
|
||||
|
@ -21,6 +21,7 @@ export default class Generator {
|
||||
)
|
||||
|
||||
this.spinner = createSpinner()
|
||||
this.spinner.enabled = !this.options.test
|
||||
}
|
||||
|
||||
async generate({ build = true, init = true } = {}) {
|
||||
|
@ -126,14 +126,16 @@ export default function webpackBaseConfig({ name, isServer }) {
|
||||
}
|
||||
|
||||
// Build progress indicator
|
||||
if (this.options.build.profile) {
|
||||
config.plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
||||
} else {
|
||||
config.plugins.push(new ProgressPlugin({
|
||||
spinner: this.spinner,
|
||||
name: isServer ? 'server' : 'client',
|
||||
color: isServer ? 'green' : 'darkgreen'
|
||||
}))
|
||||
if (!this.options.test) {
|
||||
if (this.options.build.profile) {
|
||||
config.plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
||||
} else {
|
||||
config.plugins.push(new ProgressPlugin({
|
||||
spinner: this.spinner,
|
||||
name: isServer ? 'server' : 'client',
|
||||
color: isServer ? 'green' : 'darkgreen'
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
// Add timefix-plugin before others plugins
|
||||
|
@ -86,9 +86,11 @@ export default function webpackClientConfig() {
|
||||
this.options.build.stats !== 'errors-only'
|
||||
|
||||
// Add friendly error plugin
|
||||
config.plugins.push(
|
||||
new FriendlyErrorsWebpackPlugin({ clearConsole: shouldClearConsole })
|
||||
)
|
||||
if (!this.options.test) {
|
||||
config.plugins.push(
|
||||
new FriendlyErrorsWebpackPlugin({ clearConsole: shouldClearConsole })
|
||||
)
|
||||
}
|
||||
|
||||
// Optimization
|
||||
config.optimization.splitChunks = {
|
||||
@ -182,7 +184,7 @@ export default function webpackClientConfig() {
|
||||
}
|
||||
|
||||
// https://github.com/webpack-contrib/webpack-stylish
|
||||
if (!this.options.dev) {
|
||||
if (!this.options.dev && !this.options.test) {
|
||||
config.plugins.push(new StylishPlugin())
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ export default {
|
||||
mode: 'universal',
|
||||
dev: process.env.NODE_ENV !== 'production',
|
||||
debug: undefined, // Will be equal to dev if not provided
|
||||
test: process.env.NODE_ENV === 'test',
|
||||
buildDir: '.nuxt',
|
||||
cacheDir: '.cache',
|
||||
nuxtDir: path.resolve(__dirname, '../..'),
|
||||
|
Loading…
Reference in New Issue
Block a user