webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

all bundles get rebuilt in multi-compiler mode

chochihim opened this issue · comments

I am using this middleware in multi-compiler mode. The following logs are printed after I amend a file:

[HMR] bundle 'app' rebuilt in 1069ms
[HMR] Checking for updates on the server...
[HMR] bundle 'admin' rebuilt in 56116ms
[HMR] Updated modules:
[HMR] - ./client/home/features/app/components/Header.js
[HMR] - ./client/home/pages/index.js
[HMR] - ./client/home/Root.js
[HMR] App is up to date.

I have two configs, named 'app' and 'admin' respectively. As you can see from the above logs, both 'app' and 'admin' are rebuilt. The amended file belongs to 'app' only. I suppose only 'app' is rebuilt but it is not the case. What can be potentially wrong?

Can you reproduce this same behaviour using webpack —watch on the command line?

I suspect it will, and this is a core webpack behaviour, nothing to do with this module

I serve both bundles via webpack-dev-middleware which should have watch mode enabled by default. So yes, I can reproduce it. The following are logs in backend:

webpack: Compiling...
webpack built admin 38411097736c7d2219f9 in 29885ms
webpack built app f7308fb802ed87fa1677 in 311ms
Hash: 38411097736c7d2219f9f7308fb802ed87fa1677
Version: webpack 3.7.1
Child admin:
Hash: 38411097736c7d2219f9
Time: 29885ms
Asset Size Chunks Chunk Names
admin.js 1.57 MB 0 [emitted] [big] admin
signin.js 25.7 kB 1 [emitted] signin
packages.js 4.74 MB 2 [emitted] [big] vendor
Child app:
Hash: f7308fb802ed87fa1677
Time: 311ms
Asset Size Chunks Chunk Names
main.js 758 kB 0 [emitted] [big] main
vendor.js 1.14 MB 1 [emitted] [big] vendor
0.4cb069512453868aff6f.hot-update.js 7.1 kB 0 [emitted] main
4cb069512453868aff6f.hot-update.json 43 bytes [emitted]
webpack: Compiled successfully.

Both bundles are re-built but only 'app' is built with those hot-update files.

Anyway, I will close this issue if this is core webpack behaviour.