Skip to content

webpack-dev-server@3.4.1 ignores changes in node_modules #1934

Closed
@Sayan751

Description

@Sayan751
  • 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.

For Features; What is the motivation and/or use-case for the feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions