mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: use friendly-errors plugin in client only to prevent duplicate error messages
This commit is contained in:
parent
b70ff8710f
commit
40541fdc5e
@ -1,6 +1,5 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import FriendlyErrorsWebpackPlugin from '@nuxtjs/friendly-errors-webpack-plugin'
|
|
||||||
import TimeFixPlugin from 'time-fix-plugin'
|
import TimeFixPlugin from 'time-fix-plugin'
|
||||||
import webpack from 'webpack'
|
import webpack from 'webpack'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
@ -215,16 +214,6 @@ export default class WebpackBaseConfig {
|
|||||||
plugins.push(new StatsPlugin(this.options.build.stats))
|
plugins.push(new StatsPlugin(this.options.build.stats))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add friendly error plugin
|
|
||||||
if (this.options.dev) {
|
|
||||||
plugins.push(
|
|
||||||
new FriendlyErrorsWebpackPlugin({
|
|
||||||
clearConsole: true,
|
|
||||||
logLevel: 'WARNING'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import HTMLPlugin from 'html-webpack-plugin'
|
|||||||
import BundleAnalyzer from 'webpack-bundle-analyzer'
|
import BundleAnalyzer from 'webpack-bundle-analyzer'
|
||||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
||||||
import UglifyJsWebpackPlugin from 'uglifyjs-webpack-plugin'
|
import UglifyJsWebpackPlugin from 'uglifyjs-webpack-plugin'
|
||||||
|
import FriendlyErrorsWebpackPlugin from '@nuxtjs/friendly-errors-webpack-plugin'
|
||||||
|
|
||||||
import VueSSRClientPlugin from './plugins/vue/client'
|
import VueSSRClientPlugin from './plugins/vue/client'
|
||||||
import WebpackBaseConfig from './base'
|
import WebpackBaseConfig from './base'
|
||||||
@ -129,6 +130,16 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add friendly error plugin
|
||||||
|
if (this.options.dev) {
|
||||||
|
config.plugins.push(
|
||||||
|
new FriendlyErrorsWebpackPlugin({
|
||||||
|
clearConsole: true,
|
||||||
|
logLevel: 'WARNING'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Extend config
|
// Extend config
|
||||||
if (typeof this.options.build.extend === 'function') {
|
if (typeof this.options.build.extend === 'function') {
|
||||||
const isDev = this.options.dev
|
const isDev = this.options.dev
|
||||||
|
Loading…
Reference in New Issue
Block a user