When using PostHTML Modules for templating, modifying a partial html file doesn't trigger HMR as it should.
My .posthtmlrc file:
{
"plugins": {
"posthtml-modules": {
"root": "./web"
},
"posthtml-expressions": {
"root": "./web"
}
}
}
and my package.json's devDependencies:
"devDependencies": {
"@babel/core": "^7.5.4",
"mocha": "^6.1.4",
"parcel-bundler": "^1.12.3",
"posthtml-expressions": "^1.1.1",
"posthtml-modules": "^0.4.2",
"sass": "^1.22.3"
}
Editing a partial html file included as a PostHTML module should trigger HMR.
Nothing happens when the partial html file is edited.
Maybe Parcel isn't following PostHTML modules' paths or something? I'm not sure.
Just trying to utilize HMR when developing - it makes my life easier.
https://github.com/w-biggs/1212 is the repo; https://github.com/w-biggs/1212/blob/master/web/index.html is the entry HTML file.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3 |
| posthtml-modules | 0.4.2 |
| Node | 11.14.0 |
| npm/Yarn | 6.9.2 |
| Operating System | Ubuntu 18.04.1 LTS (WSL) |
Experiencing this issue as well ๐ฅ๏ธ
I made a hacky workaround that updates index.html whenever a change is detected in one of the modules.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
FWIW this is still an issue, I'm experiencing it as well.
Why has this been marked as closed? Seems like the issue hasn't been fixed.
Or you can just update the index.html to trigger a change in the module if you use the module from index.html.
_Very important_: using dash/hyphen - inside a module as a name for a local variable binding like {{my-variable}} breaks the code.
Yup, the issue still exists in 2.0.0-nightly.469 and I can confirm that.
Most helpful comment
Why has this been marked as closed? Seems like the issue hasn't been fixed.