This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
modules/common/engine/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ export class CommonEngine {
5858 * render options
5959 */
6060 async render ( opts : RenderOptions ) : Promise < string > {
61+ const { inlineCriticalCss = true } = opts ;
62+
6163 if ( opts . publicPath && opts . documentFilePath && opts . url !== undefined ) {
6264 const url = new URL ( opts . url ) ;
6365 // Remove leading forward slash.
@@ -94,7 +96,7 @@ export class CommonEngine {
9496 extraProviders . push ( {
9597 provide : INITIAL_CONFIG ,
9698 useValue : {
97- document : opts . inlineCriticalCss
99+ document : inlineCriticalCss
98100 // Workaround for https://github.com/GoogleChromeLabs/critters/issues/64
99101 ? doc . replace ( / m e d i a = \" p r i n t \" o n l o a d = \" t h i s \. m e d i a = ' a l l ' " > < n o s c r i p t > < l i n k .+ ?> < \/ n o s c r i p t > / g, '>' )
100102 : doc ,
@@ -107,7 +109,7 @@ export class CommonEngine {
107109 const factory = await this . getFactory ( moduleOrFactory ) ;
108110
109111 const html = await renderModuleFactory ( factory , { extraProviders } ) ;
110- if ( ! opts . inlineCriticalCss ) {
112+ if ( ! inlineCriticalCss ) {
111113 return html ;
112114 }
113115
You can’t perform that action at this time.
0 commit comments