Skip to content

PostHTML and HMR #1795

Discussion options

You must be logged in to vote

I could solve the issue with the help of a nice Discord community member.
First, I've understand that transformIndexHtml is only index.html but it is in fact the file which is opened in the browser, so any html file.
So, PostHTML also works in other html files.
In addition, I could set up HMR by implementing a plugin with the handleHotUpdate function.
In this I checked the file type and used server.ws.send({ type: "full-reload" }); to reload the current html file.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@morrislaptop
Comment options

Answer selected by alexanderbluhm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants