diff --git a/packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts b/packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts index a666f7e12c05..52a2867945d7 100644 --- a/packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts +++ b/packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts @@ -63,7 +63,7 @@ export class InlineCriticalCssProcessor { // Clean up value from value less attributes. // This is caused because parse5 always requires attributes to have a string value. // nomodule="" defer="" -> nomodule defer. - content: content.replace(/(\s[a-z]+)=""/g, '$1'), + content: content.replace(/(\s(?:defer|nomodule))=""/g, '$1'), errors: critters.errors, warnings: critters.warnings, };