feat(server): warning for non web target (#2026) by Kristonitas · Pull Request #2104 · webpack/webpack-dev-server

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Modified existing tests inside addEntries.test.js.

Motivation / Use-Case

Help new developers (who check terminal output) to more quickly detect potential misconfiguration when developing a web app while setting target: "node". A more detailed explanation of this: #2026 (comment). I acknowledge this is something very obvious once you know about the configuration.

Breaking Changes

If anyone is doing strict validation of webpack-dev-server output and using the configuration in question, this might affect them. It should be quite easy to filter/ignore or modify.

Additional Info

I made this minimal repo with two scripts to see the different behaviour with "node" and "web" targets: https://github.com/Kristonitas/live-reload-fail