ElMassimo / vite-plugin-full-reload

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

Possible to work in lib mode? #18

Open ivancuric opened 1 year ago

ivancuric commented 1 year ago

Like the title says, I've tried using this in lib mode, however it doesn't trigger a reload like it does in normal mode.

Is this possible to do?

ElMassimo commented 1 year ago

Hi Ivan!

Haven't tried with Library Mode, but I think that only affects vite build.

With Vite, you can use your index.html for that purpose to get the smooth development experience.

As long as you are importing your library and visiting the local Vite dev server in your browser, I'd expect it to work as usual.

ivancuric commented 1 year ago

The thing is that I'm using a monorepo. One package builds some WASM that is symlinked to another package's public folder. The files in public are moved to dist during vite build --watch --mode development.

However, recompiling the WASM won't trigger vite's file watcher as it's not looking inside the public folder.

ElMassimo commented 1 year ago

What configuration are you using for vite-plugin-full-reload?

Also, is Vite detecting changes but not reloading the page, or is it not detecting changes at all?

Finally, are the modified files being imported in a file processed by Vite?

ivancuric commented 1 year ago

Nothing specific, but the modified files aren't being imported in a file processed by vite.

I think I'll need to look for another approach.