Copy-webpack-plugin: No automatic reload when using HMR

Created on 6 Jul 2018  路  8Comments  路  Source: webpack-contrib/copy-webpack-plugin

When using Hot Module Replacement with webpack-dev-server --hot, any changes to assets copied by copy-webpack-plugin will result in new compilation, but the browser HMR code thinks it can succesfully apply a hot update and does not reload the page. Manual browser reload is needed to load the changed assets.

What would need to happen is a HMR update failure, after which webpack-dev-server reloads automatically.

Most helpful comment

I have the same issue. For my project, we have our own code, but also consume another large library. While our code is bundled up and HMR handles it nicely, the 3rd party code (and the changes we make to that code) are not reloaded because they are copied and served, rather than bundled.

The changes are detected, but no reload occurs.

All 8 comments

I have the same issue. For my project, we have our own code, but also consume another large library. While our code is bundled up and HMR handles it nicely, the 3rd party code (and the changes we make to that code) are not reloaded because they are copied and served, rather than bundled.

The changes are detected, but no reload occurs.

If problem still exists, please create issue in webpack-dev-server, we use standard webpack api

Same issue here. When disabling HMR, automatic reload works. This is a bummer because otherwise the plugin does exactly what I need it to (thanks, by the way!)

Could you describe how this is unrelated to copy-webpack-plugin and would rather be a webpack-dev-server issue? Isn't the plugin responsible for telling webpack-dev-server if it needs to perform a full reload or not?

Also, there doesn't seem to be any bug for this in webpack-dev-server. Without knowing too much about how copy-webpack-plugin talks to webpack and webpack-dev-server, it's also a bit hard to write a complete and relevant issue (and to validate that the issue isn't in copy-webpack-plugin beforehand). May I humbly suggest that you or another contributor file a bug for this, @evilebottnawi?

Assuming that most people enable HMR in their projects (I would certainly hope so), I suppose many people encountered this and will in the future. I wouldn't consider the case closed until this is fixed, either in copy-webpack-plugin or webpack-dev-server. Maybe reopen the issue?

any solution here , issue still exists!! any advise ??

Same issue here. Sadly to see that there is no solution after 1 year.

Great plugin anyway :)

Same issue here.

As someone new to webpack I'm kind of stunned that this hasn't been addressed yet. Has anyone found any viable alternatives? My use case is very simple.

Have the same issue. It looks like there is not any module.hot.accept in copy webpack plugin so I am not sure the issue is here?

Was this page helpful?
0 / 5 - 0 ratings