-
Hi, it's me again. I have the following glob that should watch my python files for changes:
When I updated a vitepress file the watch does get triggered and it does show that the python files are being watched. However when I update a python file and save it the watch is not being triggered. What is causing this? |
Beta Was this translation helpful? Give feedback.
Answered by
brc-dd
Jun 21, 2025
Replies: 1 comment 1 reply
-
vite doesn't watch files outside project root by default ( // docs/.vitepress/config.mts
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitepress'
export default defineConfig({
vite: {
plugins: [
{
name: 'custom:watch-outside',
configureServer(server) {
server.watcher.add(fileURLToPath(new URL('../../src', import.meta.url)))
// or maybe just server.watcher.add(process.cwd())
}
}
]
}
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ISOR3X
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vite doesn't watch files outside project root by default (
docs
directory in this case). You'll need to do something like this: