Skip to content

Commit

Permalink
watch files outside of Vite root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryj89 authored Dec 17, 2024
1 parent 3017da7 commit ef40782
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/vite-plugin-watch-and-run/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ export const watchAndRun = (
// check params, throw Errors if not valid and return a new object representing the state of the plugin
const watchAndRunConf = checkConf(params)

// watch files outside of Vite root directory
for (const conf of watchAndRunConf) {
if (conf.watch) {
server.watcher.add(conf.watch);
}
}

for (const kind of kindWithPath) {
const _watcher = async (absolutePath: string) =>
watcher(server, absolutePath, kind, watchAndRunConf)
Expand Down

0 comments on commit ef40782

Please sign in to comment.