当您使用create react app并在代码中出错时,您将获得这个非常详细和精确的错误页面:

如何将此错误页面合并到我自己的自定义项目中.我怀疑需要一种类型的webpack插件.我项目中的工具是:
这是我目前的webpack配置:
import webpack from 'webpack'
import autoprefixer from 'autoprefixer'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import CopyWebpackPlugin from 'copy-webpack-plugin'
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin'
import helpers from './helpers'
const NODE_ENV = process.env.NODE_ENV
const isProd = NODE_ENV === 'production'
module.exports = {
entry: {
'app': [
helpers.root('client/app/index.jsx')
]
},
output: {
path: helpers.root('dist'),
publicPath: '/'
},
resolve: {
extensions: ['.js', '.jsx', '.json', '.css', '.scss', '.html'],
alias: {
'app': 'client/app' …Run Code Online (Sandbox Code Playgroud)