2017-06-09 8 views
0

私のReactアプリケーションでWebpack HMRを使いたいです。Webpack ManifestリクエストのHMRタイムアウト

var path = require('path'); 
var ExtractTextPlugin = require('extract-text-webpack-plugin'); 
var StyleLintPlugin = require('stylelint-webpack-plugin'); 
var webpack = require('webpack'); 

var extractScss = new ExtractTextPlugin({ filename: '[name].css' }); 
var stylelint = new StyleLintPlugin({ context: './source' }); 

module.exports = { 
    devtool: 'source-map', 
    entry: [ 
    'babel-polyfill', 
    'react-hot-loader/patch', 
    'webpack-dev-server/client?http://localhost:8080', 
    'webpack/hot/only-dev-server', 
    './source/index.js' 
    ], 
    output: { 
    filename: 'index.js', 
    path: path.resolve(__dirname, 'public') 
    }, 
    devServer: { 
    hot: true, 
    contentBase: path.resolve(__dirname, 'public'), 
    publicPath: 'http://localhost:1199/public/', 
    historyApiFallback: true, 
    proxy: { 
     "*": { 
     target: 'http://localhost:1199' 
     } 
    } 
    }, 
    module: { 
    rules: [ 
     { // SCSS 
     test: /\.scss$/, 
     use: extractScss.extract({ 
      use: [ 
      { loader: 'css-loader', options: { sourceMap: true, minimize: true } }, 
      { loader: 'sass-loader', options: { sourceMap: true, includePaths: ['./source/sass'] }}, 
      { loader: 'resolve-url-loader' } 
      ], 
      fallback: 'style-loader' 
     }) 
     }, 
     { // JavaScript 
     test: /\.js$/, 
     use: [ 
      { loader: 'babel-loader', options: { 
      "presets": [["es2015", { "modules": false }], "react" , "stage-0"], 
      "plugins": ["react-hot-loader/babel"] 
      } }, 
      { loader: 'eslint-loader'} 
     ] 
     } 
    ] 
    }, 
    plugins: [ 
    extractScss, 
    stylelint, 
    new webpack.HotModuleReplacementPlugin() 
    ] 
}; 

すべてが動作しているようですが、私は、ファイルを変更すると、コンソールが

[WDS] App updated. Recompiling... 
[WDS] App hot update... 
[HMR] Checking for updates on the server... 
[HMR] Update failed: Error: Manifest request to bcf31e519ba66d20afbe.hot-update.json timed out. at XMLHttpRequest.request.onreadystatechange (http://localhost:8080/public/index.js:38:22) 

は私が何をすべき返す:私のWebPACKの設定は次のようになりますか?

答えて

関連する問題