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(