From d5fd2a0009bc82ee1cfb07a1f8180926796f64c1 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:43:27 +0200 Subject: [PATCH] fix(@angular/build): avoid hashing development external component stylesheets When using the development server with a production configuration or with bundle hashing enabled, the external stylesheet files used by the development server for hot replacement of component styles are no longer hashed. This ensures that the requests from the runtime served by the development server match the available generated component stylesheet files. (cherry picked from commit 31f903709c4aab4524fd2d3e25f854a228de5218) --- .../build/src/tools/esbuild/angular/component-stylesheets.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts b/packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts index 711723ac8bf6..37434a68b949 100644 --- a/packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts +++ b/packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts @@ -48,6 +48,7 @@ export class ComponentStylesheetBundler { ); buildOptions.entryPoints = { [externalId]: entry }; + buildOptions.entryNames = '[name]'; delete buildOptions.publicPath; } else { buildOptions.entryPoints = [entry]; @@ -88,6 +89,7 @@ export class ComponentStylesheetBundler { }); if (externalId) { buildOptions.entryPoints = { [externalId]: `${namespace};${entry}` }; + buildOptions.entryNames = '[name]'; delete buildOptions.publicPath; } else { buildOptions.entryPoints = [`${namespace};${entry}`];