vite-plugin-vue-layouts icon indicating copy to clipboard operation
vite-plugin-vue-layouts copied to clipboard

HMR not working when changing style

Open nimonian opened this issue 3 years ago • 2 comments
trafficstars

I have the plugin set up with vite-plugin-pages. Changing the template will trigger auto reload, but changing the style will not - in fact I must restart the server to see the css changes.

<template>
  <div class="wrapper">
    <h1>Change me</h1>
    <RouterView />
  </div>
</template>

<style scoped>
.wrapper {
  color: green; 
}
</style>

nimonian avatar Aug 07 '22 11:08 nimonian

same problem. In 0.6.0, either a template change or a style change will trigger vite hmr. But in 0.7.0, a template or style change will only reload the page, and the style change will not take effect yet.

hooray avatar Aug 19 '22 11:08 hooray

same problem. In 0.6.0, either a template change or a style change will trigger vite hmr. But in 0.7.0, a template or style change will only reload the page, and the style change will not take effect yet.

Thanks. version 0.6.0 does work well. Hope a fix for 0.7 will come soon.

grandsong avatar Aug 25 '22 07:08 grandsong

Same issue here with:

Dependencies:

  • pinia 2.0.23
  • vue 3.2.40
  • vue-router 4.1.5

devDependencies:

  • autoprefixer 10.4.12
  • postcss 8.4.17
  • tailwindcss 3.1.8
  • vite 3.1.7
  • vite-plugin-md 0.20.4
  • vite-plugin-pages 0.26.0
  • vite-plugin-vue-layouts 0.7.0
  • markdown-it-anchor 8.6.5
  • @vitejs/plugin-vue 3.1.2

Thank you.

sistematico avatar Oct 12 '22 03:10 sistematico

same problem.

chenbimo avatar Oct 17 '22 07:10 chenbimo

temporary workaround: save vite.config.ts to restart the whole server

phamhongphuc avatar Nov 16 '22 07:11 phamhongphuc

0.8.0 still not fixed. no hmr when save any changes to default.vue

thefeymesaleng avatar Feb 22 '23 22:02 thefeymesaleng

@sistematico @hooray @grandsong @phamhongphuc @nimonian I rewrote this plugin。Using a simpler scheme, hmr is more accurate。Due to different principles, there is no such problem。you can try 👉 vite-plugin-vue-meta-layouts

markthree avatar Mar 27 '23 13:03 markthree

I cannot duplicate in Vitesse, with Vite 5.0.5 https://github.com/antfu/vitesse

If you find an issue with that template and Vite 5, please open a new issue

JohnCampionJr avatar Dec 05 '23 03:12 JohnCampionJr