Replies: 2 comments 5 replies
-
Hi Christian! @chmich
I'd recommend reading the documentation, in particular the Recommended Plugins section. You can use import { defineConfig } from 'vite'
import reloadOnChange from 'vite-plugin-full-reload'
export default defineConfig({
plugins: [
reloadOnChange(['config/locales/**/*', 'app/views/**/*', 'app/helpers/**/*']),
],
}) With that in place, you shouldn't need |
Beta Was this translation helpful? Give feedback.
-
Hey, Just to carry on the discussion. Currently, reloading does a full page refresh. Do you think it would be possible to do an "HMR" version without the full page refresh to skip loading all JS and CSS from scratch? Possibly using Turbo with something like |
Beta Was this translation helpful? Give feedback.
-
Hi Guys,
whats the best way for including views, view helpers or translation files in HMR?
i tried to set
"watchAdditionalPaths": ["app/views/articles/*"]
inconfig/vite.json
(for test on articles/index) but didnt work,"watchAdditionalPaths": ["app/views"]
did also not work.So, i added the slim and robust
gem 'rails_live_reload'
. I didnt had to config anything, nor excluding theapp/frontend
folder from watching. Vite is reloading the Stylesheets and JS, andrails_live_reload
is concerning about the other files and both HMR tools are working fine and no conflict. I am satisfied.So, my question is:
Had i misunderstood something, so that Vite could do the whole work alone?
Thanks,
Christian
Beta Was this translation helpful? Give feedback.
All reactions