Skip to content

Commit f367453

Browse files
authored
fix: pass rollup watch options when building in watch mode (#20674)
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 9719497 commit f367453

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/vite/src/node/build.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,10 @@ async function buildEnvironment(
726726
logger,
727727
)
728728
const resolvedChokidarOptions = resolveChokidarOptions(
729-
options.watch.chokidar,
729+
{
730+
...(rollupOptions.watch || {}).chokidar,
731+
...options.watch.chokidar,
732+
},
730733
resolvedOutDirs,
731734
emptyOutDir,
732735
environment.config.cacheDir,
@@ -736,6 +739,7 @@ async function buildEnvironment(
736739
const watcher = watch({
737740
...rollupOptions,
738741
watch: {
742+
...rollupOptions.watch,
739743
...options.watch,
740744
chokidar: resolvedChokidarOptions,
741745
},

0 commit comments

Comments
 (0)