survivejs / react-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/react/introduction/
2.02k stars 366 forks source link

Multiple "HMR ..." console outputs if >1 file in webpack.config.js entry #401

Closed rublev closed 8 years ago

rublev commented 8 years ago

For every entry I get an extra line of identical console output. I'm not sure if this is desired output, and if it is, why is it desired?

https://github.com/eveo/webpack-config-test

webpack.config.js

entry: {
    app: PATHS.app,        // app/index.js
    style: PATHS.style,    // app/main.css
    test: PATHS.test       // app/test.css
}

on initial load and reloads:

image

when i clear the console and network panel and hit record, then make a change to app/index/js, the bundle is regenerated but nothing is logged in the network, i only see the following in chrome:

image

after running the demo at https://github.com/survivejs-demos/webpack-demo the console outputs the same as above, except only two statements because there are two entries.

bebraw commented 8 years ago

Commented at https://github.com/webpack/webpack/issues/2527 . Based on webpack-dev-server code it seems to create a server/client pair for each entry.

Given that seems to be the expected behavior it's probably safe to close this now. Thanks for bringing this up, though, as I was curious about this too. Initially I thought this might be a bug but apparently it's not.