Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using API doesn't add HMR plugin entry #1703

Closed
1 of 2 tasks
rlamana opened this issue Mar 7, 2019 · 2 comments · Fixed by #1738
Closed
1 of 2 tasks

Using API doesn't add HMR plugin entry #1703

rlamana opened this issue Mar 7, 2019 · 2 comments · Fixed by #1738

Comments

@rlamana
Copy link
Contributor

rlamana commented Mar 7, 2019

Hot Module Replacement plugin entry doesn't seem to be added when using the API. The new tests on the PR #1664 use the dev server API via the test/helper.js and addEntries function in lib/utils/addEntries.js had to be manually called to make it work.

webpack Version: 4.29.0
webpack-dev-server Version: 3.1.14

  • This is a bug
  • This is a modification request

How can we reproduce the behavior?

Remove addEntries call in test/Client.test.js and the e2e test will fail because HMR is not loaded.

Expected behavior

When using the API and hot is enabled, HMR plugin entry should be also added.

@knagaitsev
Copy link
Collaborator

@evilebottnawi I messed with this issue briefly here: https://github.com/Loonride/webpack-dev-server/blob/hmr-entry-fix/lib/Server.js#L131. It would be nice if we had the ability to create the webpack compiler within Server.js. The problem I ran into was that users can use the compiler after they pass it in, so redefining it in Server.js does not work: https://github.com/webpack/webpack-dev-server/blob/master/test/Server.test.js#L25

@alexander-akait
Copy link
Member

alexander-akait commented Mar 22, 2019

@Loonride yep, we should think how to better solve this without break other code, feel free to experiment and send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants