{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1377","repository_url":"https://api.github.com/repos/webpack/webpack-dev-server","labels_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1377/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1377/comments","events_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1377/events","html_url":"https://github.com/webpack/webpack-dev-server/issues/1377","id":314314677,"node_id":"MDU6SXNzdWUzMTQzMTQ2Nzc=","number":1377,"title":"Hmr don't work in webpack 4","user":{"login":"hopperhuang","id":20254356,"node_id":"MDQ6VXNlcjIwMjU0MzU2","avatar_url":"https://avatars1.githubusercontent.com/u/20254356?v=4","gravatar_id":"","url":"https://api.github.com/users/hopperhuang","html_url":"https://github.com/hopperhuang","followers_url":"https://api.github.com/users/hopperhuang/followers","following_url":"https://api.github.com/users/hopperhuang/following{/other_user}","gists_url":"https://api.github.com/users/hopperhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/hopperhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hopperhuang/subscriptions","organizations_url":"https://api.github.com/users/hopperhuang/orgs","repos_url":"https://api.github.com/users/hopperhuang/repos","events_url":"https://api.github.com/users/hopperhuang/events{/privacy}","received_events_url":"https://api.github.com/users/hopperhuang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-04-14T09:31:07Z","updated_at":"2018-06-22T02:07:09Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  Please note that this template is not optional.\r\n  Please fill out _ALL_ fields, or your issue may be closed as \"invalid.\"\r\n  Please do not delete this template.\r\n  Please ask questions on StackOverflow or Gitter (https://gitter.im/webpack/webpack).\r\n  General questions, how-to questions, and support requests will be closed.\r\n-->\r\n\r\n* Operating System: macos 10.13.3 (17D47)\r\n* Node Version: 8.9.3\r\n* NPM Version:5.5.1\r\n* webpack Version:4.5.0 && 4.0.0 beta1\r\n* webpack-dev-server Version:3.1.3\r\n\r\n<!--\r\n  Please place an x, no spaces, in all [ ] that apply\r\n  Please note that we are NOT accepting FEATURE requests at this time.\r\n-->\r\n\r\n- [x] This is a **bug**\r\n\r\n\r\n### Code\r\ni'd like to provide the resposity: https://github.com/webpack/webpack-dev-server/tree/master/examples/api/middleware\r\n```\r\n// change config in server.js\r\n// set hot to true\r\n  const devServerOptions = Object.assign({}, webpackConfig.devServer, {\r\n+  hot: true,\r\n    stats: {\r\n      colors: true\r\n    },\r\n    before(app) {\r\n      app.use((req, res, next) => {\r\n        console.log(`Using middleware for ${req.url}`);\r\n        next();\r\n      });\r\n    }\r\n  });\r\n```\r\n\r\n### Expected Behavior\r\nchange code in app.js, the hmr will work.\r\nchanges below:\r\n```\r\n-   target.innerHTML = 'Scuccess!';\r\n+  target.innerHTML = 'webpack!';\r\n```\r\nhmr is expected to run and the html will rerender\r\n### Actual Behavior\r\n\r\nhmr not run\r\n\r\n### For Bugs; How can we reproduce the behavior?\r\n\r\nsee above\r\n\r\n### For Features; What is the motivation and/or use-case for the feature?\r\n\r\nenable hmr with api usage in webpack 4"},"comment":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/comments/399298424","html_url":"https://github.com/webpack/webpack-dev-server/issues/1377#issuecomment-399298424","issue_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1377","id":399298424,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTI5ODQyNA==","user":{"login":"twinkle77","id":17792166,"node_id":"MDQ6VXNlcjE3NzkyMTY2","avatar_url":"https://avatars2.githubusercontent.com/u/17792166?v=4","gravatar_id":"","url":"https://api.github.com/users/twinkle77","html_url":"https://github.com/twinkle77","followers_url":"https://api.github.com/users/twinkle77/followers","following_url":"https://api.github.com/users/twinkle77/following{/other_user}","gists_url":"https://api.github.com/users/twinkle77/gists{/gist_id}","starred_url":"https://api.github.com/users/twinkle77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twinkle77/subscriptions","organizations_url":"https://api.github.com/users/twinkle77/orgs","repos_url":"https://api.github.com/users/twinkle77/repos","events_url":"https://api.github.com/users/twinkle77/events{/privacy}","received_events_url":"https://api.github.com/users/twinkle77/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T02:07:09Z","updated_at":"2018-06-22T02:07:09Z","author_association":"NONE","body":"+1 Same"}}
{"actor":{"display_login":"twinkle77"}}