pwa icon indicating copy to clipboard operation
pwa copied to clipboard

Hot Module Reload

Open shaun-sweet opened this issue 7 years ago • 6 comments

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.

shaun-sweet avatar Dec 17 '17 07:12 shaun-sweet

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 avatar Dec 17 '17 13:12 LinusBorg

@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 :)

shaun-sweet avatar Dec 17 '17 20:12 shaun-sweet

Thanks a lot @LinusBorg, it was very boring... :disappointed:

Kocal avatar Jan 18 '18 07:01 Kocal

@LinusBorg This causes very weird behavior with styling files for me, have you found another work around?

daniandl avatar Mar 08 '18 14:03 daniandl

No. Also I don't see how this could influence styling.

LinusBorg avatar Mar 08 '18 15:03 LinusBorg

Ended up being a tricky sass :export {} "bug". Hope it helps the next person.

daniandl avatar Mar 08 '18 15:03 daniandl