小编Jor*_*ace的帖子

WebPack 禁用 HMR

如果相关源 JavaScript 文件已更改,我正在尝试运行一个简单的webpack-dev-server编译.bundle.js文件的程序。我现在不想启用热模块更换 (HMR)。

我的服务器正在运行,但它会向 JavaScript 控制台打印以下错误:

GET https://monkey.transposit.com:3000/sockjs-node/info?t=1486581439029 net::ERR_CONNECTION_CLOSED
    AbstractXHRObject._start @ home.bundle.js:3182
    (anonymous) @ home.bundle.js:3071
[WDS] Disconnected!
    log @ home.bundle.js:3684
    close @ home.bundle.js:3753
    sock.onclose @ home.bundle.js:3980
    EventTarget.dispatchEvent @ home.bundle.js:2917
    (anonymous) @ home.bundle.js:6021
GET https://monkey.transposit.com:3000/sockjs-node/info?t=1486581439029 net::ERR_CONNECTION_CLOSED
    AbstractXHRObject._start @ home.bundle.js:3182
    (anonymous) @ home.bundle.js:3071
GET https://monkey.transposit.com:3000/sockjs-node/info?t=1486581440063 net::ERR_CONNECTION_CLOSED
    AbstractXHRObject._start @ home.bundle.js:3182
    (anonymous) @ home.bundle.js:3071
Run Code Online (Sandbox Code Playgroud)

我不清楚浏览器试图做什么,我看到了这些错误。(特别是因为捆绑包正在成功编译和提供)。

这是我的webpack.config.js

const path = require('path');
module.exports = {
  entry: {
    project_console: './src/console/console',
    …
  },
  output: {
    filename: '[name].bundle.js',
    path: path.join(__dirname, 'dist'),
    publicPath: …
Run Code Online (Sandbox Code Playgroud)

reactjs webpack webpack-dev-server webpack-hmr

6
推荐指数
1
解决办法
9186
查看次数