2016-05-24 8 views
0

私はwebpackに、私の友人になれる機会を与えるたびに問題があります! 今回は、反応ホットローダー、webpack & webpack-dev-serverでホットモジュールリロードを有効にしようとしていますが、webpack-dev-serverがブラウザで間違ったURLを取得しようとしているようです。Webpack dev serverが間違ったURLに接続しようとしました

これは、クロームV50のコンソールからのエラーです:

GET http://public/info?t=1464117419740 net::ERR_NAME_NOT_RESOLVED 

完全なログ:ここ

abstract-xhr.js:132 GET http://public/info?t=1464117419740 net::ERR_NAME_NOT_RESOLVEDAbstractXHRObject._start @ abstract-xhr.js:132(anonymous function) @ abstract-xhr.js:21 
index.js:70 [WDS] Disconnected!sock.onclose @ index.js:70EventTarget.dispatchEvent @ eventtarget.js:51(anonymous function) @ main.js:356 
abstract-xhr.js:132 GET http://public/info?t=1464117421752 net::ERR_NAME_NOT_RESOLVEDAbstractXHRObject._start @ abstract-xhr.js:132(anonymous function) @ abstract-xhr.js:21 

は私のWebPACKの設定です:

{ 
    devtool: 'source-map', 
    entry: [ 
    // 'webpack-dev-server/client?path=http://localhost:3001/', // I have tested it with no luck 
    'webpack-hot-middleware/client?path=http://localhost:3001/', 
    'webpack/hot/dev-server', 
    './index.js' 
    ], 
    output: { 
    path: path.join(__dirname, 'public'), 
    publicPath: '/public/', 
    filename: 'bundle.js' 
    }, 
    plugins: [ 
    new webpack.HotModuleReplacementPlugin(), 
    new ExtractTextPlugin('index.css', { 
     allChunks: true 
    }) 
    ], 
    postcss: [ 
    values, 
    cssnext 
    ], 
    devServer: { 
    hot: true, 
    inline: true, 
    contentBase: './' 
    } 
    module: { 
    loaders: [ 
     { 
     test: /\.js$/, 
     loaders: ['react-hot','babel'], 
     exclude: /node_modules/ 
     }, 
     { 
     test: /\.(css)$/, 
     exclude: /node_modules/, 
     loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss') 
     }, 
     { 
     test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/, 
     loader: 'file' 
     } 
    ] 
    } 
} 

答えて

1

それはWebPACKの-DEV-上ですサーバー/クライアントのエントリポイントであり、クエリ文字列内のパスであり、パラメータ名はありません。

webpack-dev-server/client? http://localhost:3001

関連する問題