-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with node_modules #10
Comments
@kewp The Vite server watcher skips |
After a bit more investigation I think I figured it out! 🎉 Because I put this relative path in a variable and used it for both Working example:import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import ViteRestart from "vite-plugin-restart";
// Change to any package in your node_modules
const myModule = "pick-any-module";
const modulePath = `node_modules/${myModule}/*`;
export default defineConfig({
plugins: [
react(),
ViteRestart({
reload: [modulePath],
}),
],
server: {
watch: {
ignored: [`!${path.join(process.cwd(), modulePath)}`],
},
},
optimizeDeps: {
exclude: [myModule],
},
}); |
Not sure why, but this does not work when watching something in
node_modules
... Any idea why?The text was updated successfully, but these errors were encountered: