Skip to content

Commit 736e126

Browse files
committed
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 (cherry picked from commit c0b76e3)
1 parent 2648e81 commit 736e126

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/build/src/builders/dev-server/vite-server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ export async function setupServer(
510510
join(serverOptions.workspaceRoot, `.angular/vite-root`, serverOptions.buildTarget.project),
511511
);
512512

513-
const cacheDir = join(serverOptions.cacheOptions.path, 'vite');
513+
const cacheDir = join(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite');
514514
const configuration: InlineConfig = {
515515
configFile: false,
516516
envFile: false,

0 commit comments

Comments
 (0)