vite-plugin-full-reload icon indicating copy to clipboard operation
vite-plugin-full-reload copied to clipboard

Possible to work in lib mode?

Open ivancuric opened this issue 2 years ago • 4 comments

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?

ivancuric avatar Mar 09 '23 09:03 ivancuric

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.

ElMassimo avatar Mar 09 '23 12:03 ElMassimo

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.

ivancuric avatar Mar 09 '23 14:03 ivancuric

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?

ElMassimo avatar Mar 09 '23 16:03 ElMassimo

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.

ivancuric avatar Mar 14 '23 11:03 ivancuric