diff --git a/packages/angular/ssr/src/common-engine.ts b/packages/angular/ssr/src/common-engine.ts index bcc2ccbd112a..9a2b0fbe0f81 100644 --- a/packages/angular/ssr/src/common-engine.ts +++ b/packages/angular/ssr/src/common-engine.ts @@ -98,22 +98,16 @@ export class CommonEngine { ...this.providers, ]; - let doc = opts.document; - if (!doc && opts.documentFilePath) { - doc = await this.getDocument(opts.documentFilePath); + let document = opts.document; + if (!document && opts.documentFilePath) { + document = await this.getDocument(opts.documentFilePath); } - if (doc) { + if (document) { extraProviders.push({ provide: INITIAL_CONFIG, useValue: { - document: inlineCriticalCss - ? // Workaround for https://github.com/GoogleChromeLabs/critters/issues/64 - doc.replace( - / media="print" onload="this\.media='.+?'"(?: ngCspMedia=".+")?>