Closed stijns96 closed 1 year ago
@stijns96 Did you try serving your theme with the --live-reload full-page
flag? https://shopify.dev/docs/themes/tools/cli/commands#dev-flags
Hi @montalvomiguelo,
That is somehow working a bit better, but still Vite will reload the full page.
2 things here.
--live-reload off
to completely disable Shopify's HRM. This will give the same bug. Isn't that weird?I actually want the HRM (without page reload), while my styles are updating as well. Isn't that possible?
@stijns96 The Shopify CLI hot reloads changes to sections and css files. You would want to change that behavior to full-page --live-reload full-page
so that your Tailwind styles apply correctly.
https://github.com/barrel/shopify-vite/assets/5134470/0cfd3522-8556-473b-91f3-fe7e792bda28
Tailwind+Vite will trigger a page reload after you change liquid files; that's expected.
Please check the Tailwind setup in this project https://github.com/montalvomiguelo/hydrogen-theme (:
Hi there,
Whenever I save a file, Vite will reload the page. This breaks the HMR of Shopify. HMR does work, but Vite reloads the whole page after this has been done. After the reload it falls back to the state before saving the file.
Shopify CLI only reloads the full page if you save a JS file. I can imagine that we have to reload the page, since the frontend files are hosted on another IP. But this is not really a workable solution...
https://github.com/barrel/shopify-vite/assets/47820758/7200ca5d-0997-4b10-a37f-f60df51bb6f0