Replies: 3 comments 1 reply
-
I have this problem too - I have a mock API yaml file which I want to cause a reload on the frontend in dev mode. I found this in the docs: https://vite.dev/config/build-options.html#build-watch -> https://rollupjs.org/configuration-options/#watch-include
I'm not sure how to solve this. But it shows that using Related SO answer here: https://stackoverflow.com/a/63548394/9889773 |
Beta Was this translation helpful? Give feedback.
-
I found a solution in install vite-plugin-restart. I hope this helps. // vite.config.js
import ViteRestart from 'vite-plugin-restart'
export default {
plugins: [
ViteRestart({
restart: [
'./vite.config.ts',
]
})
],
} there are similar issues. |
Beta Was this translation helpful? Give feedback.
-
The proposed solutions using either I found, however, if I change the reference to the file from a package rerference to a releative path, it will get reloaded: {
"astro:config:setup"({ addRenderer }) {
addRenderer({
name: "juno-astro",
- clientEntrypoint: `juno-astro/client.ts`,
+ clientEntrypoint: `${import.meta.dirname}/client.ts`,
});
},
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I thought I could use this to watch the vite.config.ts file so that everything reloads when that file changes, but it actually doesn't trigger any changes.
My config file:
To build and watch, I use the command:
vite build --mode='development' --watch
.What am I missing? How do I tell vite to watch other files in the project directory and trigger a rebuild when they change?
Beta Was this translation helpful? Give feedback.
All reactions