{"action":"closed","issue":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1390","repository_url":"https://api.github.com/repos/webpack/webpack-dev-server","labels_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1390/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1390/comments","events_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/1390/events","html_url":"https://github.com/webpack/webpack-dev-server/issues/1390","id":318377653,"number":1390,"title":"Browser autorefreshing not work and after manually refreshing not see changes","user":{"login":"freszyk","id":3948456,"avatar_url":"https://avatars1.githubusercontent.com/u/3948456?v=4","gravatar_id":"","url":"https://api.github.com/users/freszyk","html_url":"https://github.com/freszyk","followers_url":"https://api.github.com/users/freszyk/followers","following_url":"https://api.github.com/users/freszyk/following{/other_user}","gists_url":"https://api.github.com/users/freszyk/gists{/gist_id}","starred_url":"https://api.github.com/users/freszyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freszyk/subscriptions","organizations_url":"https://api.github.com/users/freszyk/orgs","repos_url":"https://api.github.com/users/freszyk/repos","events_url":"https://api.github.com/users/freszyk/events{/privacy}","received_events_url":"https://api.github.com/users/freszyk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-27T11:40:26Z","updated_at":"2018-04-27T12:42:01Z","closed_at":"2018-04-27T12:42:00Z","author_association":"NONE","body":"Hello. I'm trying to run webpack-dev-server with autorefreshing from 6 hours and this driving me insane.\r\n\r\nI configured everything like in webpack documentation and it doesnt work.\r\nI was reading all posts and issues about this and nothing helped me to resolve this problem.\r\n\r\nThis is my configuration:\r\n\r\n```const webpack = require('webpack');\r\nconst path = require('path');\r\nconst glob = require('glob');\r\n\r\n// Plugins\r\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\r\n\r\n// Config\r\nmodule.exports = {\r\n    mode: 'development',\r\n    devtool: 'inline-source-map',\r\n    entry: () => {\r\n        return glob.sync('./src/js/*.js').reduce(\r\n            function(prev, curr) {\r\n                prev[path.basename(curr, '.js')] = curr;\r\n                return prev;\r\n            }, {}\r\n        );\r\n    },\r\n    output: {\r\n        filename: '[name].bundle.js',\r\n        path: path.resolve(__dirname, 'dist')\r\n    },\r\n    module: {\r\n        rules: [\r\n            { // Loading JavaScript\r\n                test: /\\.js$/,\r\n                use: ['babel-loader']\r\n            },\r\n            { // Loading CSS\r\n                test: /\\.css$/,\r\n                use: ['style-loader', 'css-loader']\r\n            },\r\n            { // Loading Sass\r\n                test: /\\.scss$/,\r\n                use: ['style-loader', 'css-loader', 'sass-loader']\r\n            },\r\n            { // Loading Images\r\n                test: /\\.(png|svg|jpg|gif)$/,\r\n                use: [{\r\n                    loader: 'file-loader', options: {\r\n                        outputPath: './img/'\r\n                    }\r\n                }]\r\n            },\r\n            { // Loading Fonts\r\n                test: /\\.(woff|woff2|eot|ttf|otf)$/,\r\n                use: [{\r\n                    loader: 'file-loader', options: {\r\n                        outputPath: './fonts/'\r\n                    }\r\n                }]\r\n            }\r\n        ]\r\n    },\r\n    plugins: [\r\n        new HtmlWebpackPlugin({\r\n            filename: 'index.html',\r\n            template: './src/index.html'\r\n        }),\r\n        new webpack.NamedModulesPlugin(),\r\n        new webpack.HotModuleReplacementPlugin()\r\n    ],\r\n    devServer: {\r\n        contentBase: 'dist',\r\n    },\r\n};\r\n```\r\n\r\nThis is my package.json:\r\n```\r\n{\r\n  \"name\": \"HTML5_Base\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"private\": true,\r\n  \"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\r\n    \"watch\": \"webpack --watch\",\r\n    \"start\": \"webpack-dev-server --hot --open\",\r\n    \"build\": \"webpack\"\r\n  },\r\n  \"license\": \"MIT\",\r\n  \"devDependencies\": {\r\n    \"babel-core\": \"^6.26.2\",\r\n    \"babel-loader\": \"^7.1.4\",\r\n    \"babel-preset-env\": \"^1.6.1\",\r\n    \"clean-webpack-plugin\": \"^0.1.19\",\r\n    \"css-loader\": \"^0.28.11\",\r\n    \"file-loader\": \"^1.1.11\",\r\n    \"html-webpack-plugin\": \"^3.2.0\",\r\n    \"node-sass\": \"^4.9.0\",\r\n    \"sass-loader\": \"^7.0.1\",\r\n    \"style-loader\": \"^0.21.0\",\r\n    \"url-loader\": \"^1.0.1\",\r\n    \"webpack\": \"^4.6.0\",\r\n    \"webpack-cli\": \"^2.0.15\",\r\n    \"webpack-dev-server\": \"^3.1.3\"\r\n  }\r\n}\r\n```\r\n\r\nThis is my folder structure:\r\n```\r\napp/\r\n  -dist/\r\n      -fonts\r\n      -img\r\n      index.html\r\n      index.bundle.js\r\n  -src\r\n      -fonts\r\n      -img\r\n      -js/\r\n            -addons/\r\n            print.js\r\n        index.js\r\n    -scss\r\n        index.css\r\n        index.scss\r\n    index.html\r\n```\r\n\r\nWhen I biuld prject with webpack everything works fine webpack --watch works too.\r\nWhen I run webpack-dev-server and change file console compiling files but not reloading browser and even if I reload browser manually I dont see changes.\r\n\r\nThis is compilation part from console:\r\n```\r\ni ｢wdm｣: Compiling...\r\ni ｢wdm｣: Hash: f3ce04c1f69050d8f801\r\nVersion: webpack 4.6.0\r\nTime: 566ms\r\nBuilt at: 2018-04-27 13:20:05\r\n                                   Asset      Size        Chunks             Chunk Names\r\n    f7f6bba26d643604c7b8.hot-update.json  44 bytes                [emitted]\r\n                         index.bundle.js  1.42 MiB         index  [emitted]  index\r\nindex.dd55a104300166e15c4f.hot-update.js  2.48 KiB  index, index  [emitted]  index, index\r\n    dd55a104300166e15c4f.hot-update.json  47 bytes                [emitted]\r\n                              index.html  1.14 KiB                [emitted]\r\n + 19 hidden assets\r\nEntrypoint index = index.bundle.js index.dd55a104300166e15c4f.hot-update.js index.dd55a104300166e15c4f.hot-update.js\r\n[./node_modules/css-loader/index.js!./src/scss/index.css] ./node_modules/css-loader!./src/scss/index.css 618 bytes {index} [built]\r\n    + 56 hidden modules\r\nChild html-webpack-plugin for \"index.html\":\r\n                                   Asset      Size  Chunks             Chunk Names\r\n    f7f6bba26d643604c7b8.hot-update.json  44 bytes          [emitted]\r\n     + 1 hidden asset\r\n    Entrypoint undefined = index.html\r\n       4 modules\r\ni ｢wdm｣: Compiled successfully.\r\n```"}}
{"actor":{"display_login":"evilebottnawi"}}