Replies: 2 comments 6 replies
-
Hello, Actually, vite can't watch files outsite of the current place, so you can't "../" (last time I checked) Maybe you can run your vite at the root level? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your fast response! I see about the Vite limitation, that's why I thought maybe this plugin would work around that. There is also vite-plugin-watch-workspace but it tries to run esbuild on scss files and seems there's no option to stop that. Your plugin seems more robust in the sense that you make no assumptions on how to handle watched files which seems perfect for my needs (and also a nice delay option). I was able to get it to work for my needs by inserting the following lines. I am not sure if doing this will spawn some dragons, but for my purpose it seems to work - do you have some sense of issues that can happen by doing this? Insert into line 255: for (const conf of watchAndRunConf) {
if (conf.watch) {
server.watcher.add(conf.watch);
}
} kitql/packages/vite-plugin-watch-and-run/src/lib/index.ts Lines 252 to 266 in 3017da7 |
Beta Was this translation helpful? Give feedback.
-
Hello!
I am trying to use
vite-plugin-watch-and-run
to watch for some files outside of thepackages/components
directory where Vite is ran. I am trying to get it to watch the scss files inpackages/tokens
.I thought I could just do this but it seems it is unable to reach it. I made sure the path it output was correct and was able to cd into it. Is there some trick to this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions