From 1654acf0ff3010b619a22d11f17eec9975d8e2a2 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:11:20 -0400 Subject: [PATCH] fix(@angular/build): relax constraints on external stylesheet component id The number of digits in the component identifier that is generated at runtime can vary. The check for a valid identifier now accounts for this case. --- .../build/src/tools/vite/middlewares/assets-middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts index e5d04887aa44..a2633c21af27 100644 --- a/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts +++ b/packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts @@ -88,7 +88,7 @@ export function createAngularAssetsMiddleware( // Shim the stylesheet if a component ID is provided if (componentId.length > 0) { // Validate component ID - if (/^[_.\-\p{Letter}\d]+-c\d{9}$/u.test(componentId)) { + if (/^[_.\-\p{Letter}\d]+-c\d+$/u.test(componentId)) { loadEsmModule('@angular/compiler') .then((compilerModule) => { const encapsulatedData = compilerModule.encapsulateStyle(