From 4eff67782da16d0c08d56f07087ecabd56b30efc 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. --- .../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}`];