ElMassimo / vite-plugin-full-reload

♻️ Automatically reload the page when files are modified
MIT License
147 stars 8 forks source link

Altering excluded files blocks Vite HMR #10

Closed pawelzwronek closed 1 year ago

pawelzwronek commented 2 years ago

Great plugin thx! One issue made me move to vite-plugin-live-reload. When I set path to watch for only some extensons like 'src/**/*.ts' then altering other files, prevent Vite from hot reload that other files. I was testing this with .sccs files.

ElMassimo commented 2 years ago

Interesting, probably related to reusing the same watcher than Vite is using.

Normally, you wouldn't need to force a reload for any file that is imported (such as .ts files), as Vite would already reload the page on changes.

Can you share your use case?

pawelzwronek commented 2 years ago

Normally Vite is hot reloading only one file I changed. In normal/properly written app I think this is expected behaviour but in my app this lead to many memory leaks on older version of the file, which Vite is not removing. Also old code was sometimes still running and conflicting with the new version of the file. So for me best option is to reload whole page to have fresh start.

ElMassimo commented 1 year ago

Closing for now, as watching files that have HMR support is out of scope for this plugin.