Skip to content

Commit 1654acf

Browse files
committed
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.
1 parent 1f4428f commit 1654acf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/build/src/tools/vite/middlewares/assets-middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function createAngularAssetsMiddleware(
8888
// Shim the stylesheet if a component ID is provided
8989
if (componentId.length > 0) {
9090
// Validate component ID
91-
if (/^[_.\-\p{Letter}\d]+-c\d{9}$/u.test(componentId)) {
91+
if (/^[_.\-\p{Letter}\d]+-c\d+$/u.test(componentId)) {
9292
loadEsmModule<typeof import('@angular/compiler')>('@angular/compiler')
9393
.then((compilerModule) => {
9494
const encapsulatedData = compilerModule.encapsulateStyle(

0 commit comments

Comments
 (0)