2017-12-16 12 views
3

, 당신이 매우 상세하고 정확한 오류 페이지를 얻을 : 내 자신 만의 프로젝트에이 오류 페이지를 통합 할 수있는 방법 enter image description here어떻게 생성 - 반응 - 애플 리케이션 사용하는 오류 페이지를 사용자 정의 프로젝트에 통합 할 수 있습니까? 사용자가 만든 사용하는 응용 프로그램을 반응 코드에 오류가있는 경우

. 나는 webpack 플러그인의 유형이이 필요하다고 생각합니다. 내 프로젝트의 도구는 다음과 같습니다

  1. express.js
  2. 웹팩
  3. 바벨을 Node.js를
  4. 말대꾸
  5. 여기
  6. REDUX

는 반응 현재 웹팩 구성 :

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' 
    } 
    }, 
    stats: { 
    colors: true, 
    modules: true, 
    reasons: true, 
    errorDetails: true 
    }, 
    devtool: 'cheap-module-eval-source-map', 
    module: { 
    rules: [ 
     // absolutely necessary for font-awesome 
     // you NEED the file-loader & css-loader modules 
     { 
     test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)(\?.*$|$)/, 
     loader: 'file-loader' 
     }, 
     // JS files 
     { 
     test: /\.jsx?$/, 
     include: helpers.root('client'), 
     exclude: /node_modules/, 
     use: [ 
      { 
      loader: "babel-loader", 
      // options: { 
      // "presets": [["env", {"modules": false}], "react"] 
      // } 
      } 
     ] 
     }, 

     // SCSS files 
     // or test: /(\.scss|\.sass)$/, 
     // or test: /.(scss|sass)$/, 
     // or test: /.s[ac]ss$/, 
     // verdict: none of the above required! 
     { 
     test: /.sass$/, 
     loader: ExtractTextPlugin.extract({ 
      fallback: 'style-loader', 
      use: [ 
      { 
       loader: 'css-loader', 
       options: { 
       'sourceMap': true, 
       'importLoaders': 1 
       } 
      }, 
      { 
       loader: 'postcss-loader', 
       options: { 
       plugins:() => [ 
        autoprefixer 
       ] 
       } 
      }, 
      'sass-loader' 
      ] 
     }) 
     } 
    ] 
    }, 

    plugins: [ 
    new webpack.optimize.ModuleConcatenationPlugin(), 
    new webpack.HotModuleReplacementPlugin(), 
    new webpack.NoEmitOnErrorsPlugin(), 

    new FriendlyErrorsPlugin({ 
     clearConsole: <false></false> 
    }), 

    new webpack.DefinePlugin({ 
     'process.env': { 
     NODE_ENV: JSON.stringify(NODE_ENV) 
     } 
    }), 

    new HtmlWebpackPlugin({ 
     template: helpers.root('client/public/index.html'), 
     inject: 'body' 
    }), 

    new ExtractTextPlugin({ 
     filename: 'css/[name].[hash].css', 
     disable: !isProd 
    }), 

    new CopyWebpackPlugin([{ 
     from: helpers.root('client/public') 
    }]) 
    ] 
} 
+0

당신은 살펴나요 만들-반응 - 응용 프로그램 소스 코드와 종속성을 그들은 그것을 어떻게 볼 수 있나요? –

답변