Manav Rathi
@mnvr@mastodon.social
Finally solved my hot reload woes!
Try what I may, #vite wouldn't hot reload my plain #HTML files consistently. Sometimes it worked, sometimes not. There are no other great alternatives unfortunately.
This fixed the issue! (so far 😅). Add a small inline plugin
export default {
plugins: [
{
name: 'html-reload',
handleHotUpdate({ file, server }) {
if (file.endsWith('.html')) {
server.ws.send({ type: 'full-reload', path: '*' });
}
},
}
]
}

Qiita - 人気の記事