Closed
Description
- Operating System: Windows (Server 2019)
- Node Version: 10.15.0
- NPM Version: 6.4.1
- webpack Version: 4.32.2
- webpack-dev-server Version: 3.4.1
- This is a bug
- This is a modification request
Code
// main/webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseUrl = "/";
/** @type {() => import("webpack").Configuration} */
module.exports = () => ({
plugins: [
new HtmlWebpackPlugin({
template: "index.ejs",
metadata: { baseUrl }
})
]
})
// main/src/index.js
const {Service} = require("service"); // a dependency from a local node module
const div = document.createElement("div");
div.innerText = new Service().method();
document.querySelector("body").appendChild(div);
Expected Behavior
When any changes occur in the node_modules
, webpack-dev-server
should trigger a new build.
Actual Behavior
It is not happening after I upgraded to the latest webpack-dev-server@3.4.1
. With the earler version of 3.3.1
it was working perfectly. If the fix is non-trivial, are there better workarounds rather than pinning the version?
For Bugs; How can we reproduce the behavior?
I have created the repo https://github.com/Sayan751/webpack-reloading-issue to demonstrate this problem. The steps to reproduce the problem is detailed there.