pwa
pwa copied to clipboard
Hot Module Reload
If you run vue init vuejs-templates/pwa test
to clone a new template then run it after installing all the dependencies, you'll notice HMR is not HMR. It is doing a hard refresh.
We experienced this as well upstream in the webpack template, back when when we upgraded to webpack 3. It turned out that it was related to the html-webpack-template and this code: https://github.com/vuejs-templates/webpack/issues/751#issuecomment-325323584
So you have this in dev-server.js
, and this is the problem:
https://github.com/vuejs-templates/pwa/blob/development/template/build/dev-server.js#L38-L44
We decided to remove that to get HMR going again:
https://github.com/vuejs-templates/webpack/blob/1.1.0/template/build/dev-server.js#L38-L46
~~Edit: It seems that alone doesn't fix it :( Will look into it more later. If anyone else has an idea, please speak up :)~~ - fix tested and works.
@LinusBorg yea, I noticed the upstream issue as well when I tried a new template on that end. Lemme try what you're suggesting and I'll report back. Thanks for the quick reply!
Edit: Looks good :)
Thanks a lot @LinusBorg, it was very boring... :disappointed:
@LinusBorg This causes very weird behavior with styling files for me, have you found another work around?
No. Also I don't see how this could influence styling.
Ended up being a tricky sass :export {} "bug". Hope it helps the next person.