From c0b76e3377e7f9ded023e5350b9a9ae90a7d31ee Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 1 Oct 2024 13:10:05 +0000 Subject: [PATCH] fix(@angular/build): separate Vite cache by project Previously, Vite prebundled dependencies were stored in a shared directory across all projects, which caused the `_metadata.json` files to be overwritten. This resulted in undefined behavior, such as re-optimizing dependencies on each run when multiple projects were present in the workspace. Additionally, it introduced conflicts when running multiple `ng serve` processes simultaneously. Closes #28536 --- packages/angular/build/src/builders/dev-server/vite-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/build/src/builders/dev-server/vite-server.ts b/packages/angular/build/src/builders/dev-server/vite-server.ts index 3d147872f7a5..6f17f94759f3 100644 --- a/packages/angular/build/src/builders/dev-server/vite-server.ts +++ b/packages/angular/build/src/builders/dev-server/vite-server.ts @@ -574,7 +574,7 @@ export async function setupServer( join(serverOptions.workspaceRoot, `.angular/vite-root`, serverOptions.buildTarget.project), ); - const cacheDir = join(serverOptions.cacheOptions.path, 'vite'); + const cacheDir = join(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite'); const configuration: InlineConfig = { configFile: false, envFile: false,