Skip to content

Commit a21046f

Browse files
committed
refactor(@angular-devkit/build-angular): fully disable Vite internal file watching
With the Vite-based development server, the build pipeline itself watches for files and rebuilds the relevant parts of the application as needed. The Vite file watching is unneeded and was previously setup to ignore all files. This worked but was not ideal as chokidar was still initialized inside Vite. However, Vite now supports fully disabling the file watching by passing `null` for the Vite watch option value.
1 parent e859784 commit a21046f

File tree

1 file changed

+2
-4
lines changed
  • packages/angular_devkit/build_angular/src/builders/dev-server

1 file changed

+2
-4
lines changed

packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,8 @@ export async function setupServer(
454454
open: serverOptions.open,
455455
headers: serverOptions.headers,
456456
proxy,
457-
// Currently does not appear to be a way to disable file watching directly so ignore all files
458-
watch: {
459-
ignored: ['**/*'],
460-
},
457+
// File watching is handled by the build directly. `null` disables file watching for Vite.
458+
watch: null,
461459
// This is needed when `externalDependencies` is used to prevent Vite load errors.
462460
// NOTE: If Vite adds direct support for externals, this can be removed.
463461
preTransformRequests: externalMetadata.explicit.length === 0,

0 commit comments

Comments
 (0)