diff --git a/.changeset/wet-walls-camp.md b/.changeset/wet-walls-camp.md new file mode 100644 index 0000000000..4d79eb8f82 --- /dev/null +++ b/.changeset/wet-walls-camp.md @@ -0,0 +1,5 @@ +--- +"@react-router/dev": patch +--- + +Copy `server.watch` config options from `vite.config.(ts|js)` file to child vite server in development mode. diff --git a/contributors.yml b/contributors.yml index e6c663f7be..215c009e79 100644 --- a/contributors.yml +++ b/contributors.yml @@ -65,6 +65,7 @@ - brophdawg11 - btav - bvangraafeiland +- c0va23 - camthompson - CanRau - caprolactam diff --git a/packages/react-router-dev/vite/plugin.ts b/packages/react-router-dev/vite/plugin.ts index d64f59fd53..5a544f8a6e 100644 --- a/packages/react-router-dev/vite/plugin.ts +++ b/packages/react-router-dev/vite/plugin.ts @@ -1448,7 +1448,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => { cacheDir: "node_modules/.vite-child-compiler", mode: viteConfig.mode, server: { - watch: viteConfig.command === "build" ? null : undefined, + watch: viteConfig.command === "build" ? null : viteConfig.server.watch, preTransformRequests: false, hmr: false, },