html 插件提示错误,Webpack友好的错误提示插件friendly-errors-webpack-plugin

friendly-errors-webpack-plugin 介绍

friendly-errors-webpack-plugin识别某些类别的webpack错误,并清理,聚合和优先级,以提供更好的开发人员体验。

我们运行nodejs 可以看到错误信息如下:

html 插件提示错误,Webpack友好的错误提示插件friendly-errors-webpack-plugin_第1张图片

安装入门

npm install friendly-errors-webpack-plugin --save-dev

基本用法

只需将friendlyerrorswebpackplugin添加到webpack配置中的插件部分即可。

var friendlyerrorswebpackplugin = require('friendly-errors-webpack-plugin');

var webpackconfig = {

// ...

plugins: [

new friendlyerrorswebpackplugin(),

],

// ...

}

关闭错误

您需要通过将webpack config quiet选项设置为true来关闭所有错误日志记录。

app.use(require('webpack-dev-middleware')(compiler, {

quiet: true,

publicpath: config.output.publicpath,

你可能感兴趣的:(html,插件提示错误)