### 🐛 bug report
No files or configs
I have empty HTML without any external resources (such as local CSS files or JS). When I change it and save I should get an immediate update in the browser without refresh while in dev mode.
I change anything in the HTML file, it gets rebuilt but not refreshed automatically in the browser. I need to click refresh.
When I add any import. For example to the CSS external local file and then refresh the page once, all changes to HTML start to immediately displayed on saving without a need to press refresh
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<p style="color: red">Hello world</p>
</body>
</html>
| Software         | Version(s) |
| ---------------- | ---------- |
| Parcel           | latest to date
| Node             | 8.9.3
| Yarn         | 1.5
| Operating System | Mac OS High Sierra
There is no javascript bundle to append the HMR runtime to.
https://github.com/parcel-bundler/parcel/blob/420ed63ed18c6a09e8b25754d0142b3b87ebcd71/src/packagers/JSPackager.js#L185-L191
We would have to inject a script tag into the html file.
Glad that my bug contribution is not false positive :) Waiting for the fix ;)
Could I work on this?
@vsui I think you could. This bug is quite annoying.
I'll take this on if it's still open @RIP21 @vsui.
This sure needs to be fixed. I’m not familiar with the internals of Parcel, but I guess that to support auto reloading without JS, we’d have to:
Browsersync injects its client script after the opening <body> tag, would that be wise to do here too?
if page has no one scripts, you must automatically add reload helper script, to the beginning of the head element, like:
<head>
  <script id="__parcel__helper__">
    /* code */
    /* code */
    /* code */
    // clear html from helper script tag, just in case
    var helperScriptElement = document.getElementById('__parcel__helper__')
    helperScriptElement.parentNode.removeChild(helperScriptElement);
  </script>
  <title> e.t.c. </title> 
</head>
I finally "solved" this by adding a live.js script into the *.pug pages. It does a good job at reloading the pages--might not be as fast as Parcel's hmr, but it works.
// index.pug
if env === 'development'
    script(src="https://livejs.com/live.js#html")
// pug.config.js
module.exports = {
    locals: {
        env: process.env.NODE_ENV
    }
};
Don't forget to remove this line when building for production.
Interested by this feature.
Most helpful comment
There is no javascript bundle to append the HMR runtime to.
https://github.com/parcel-bundler/parcel/blob/420ed63ed18c6a09e8b25754d0142b3b87ebcd71/src/packagers/JSPackager.js#L185-L191
We would have to inject a script tag into the html file.