- Issue created by @dcavins
- π¦πΊAustralia darvanen Sydney, Australia
Did you get HMR working with that example?
- πΊπΈUnited States mortona2k Seattle
I have hmr working with lando and unocss. This module will either serve the rendered source in dev mode, or modify libraries to point to the dist according to manifest.json when not in dev mode. Most of the tricky parts are getting your setup right.
The unocss dev tools uses hmr to refresh the css when it's changed. I have node running in lando, and proxied to node.mysite.lndo.site. The unocss devtools are loaded in my main.js entry point. That's my theme's global library, and when it loads, it connects back to vite for the live refresh. There's an open issue here, where I had to modify a file in node_modules to disable cors for it to work: https://github.com/unocss/unocss/issues/2822
Here's my setup: https://www.drupalarchitect.info/articles/drupal-theme-vite-and-unocss-l...
- π¦πΊAustralia darvanen Sydney, Australia
Thanks, turns out my problem stemmed from using @vitejs/plugin-react. I'll open a ticket with the details.