Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit dbad8e9

Browse files
committed
fix(@nguniversal/common): inline critical font-face rules when using critical css inlining
When critical font rules are not inlined it will cause blinking as during first render the fallback font will be rendered. Closes #2002
1 parent af54864 commit dbad8e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/builders/src/prerender/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async function _renderUniversal(
130130
serverBundlePath,
131131
outputPath,
132132
browserOptions.deployUrl || '',
133-
normalizedStylesOptimization.inlineCritical === true ? 'true' : 'false' ,
134-
normalizedStylesOptimization.minify === true ? 'true' : 'false' ,
133+
normalizedStylesOptimization.inlineCritical ? 'true' : 'false' ,
134+
normalizedStylesOptimization.minify ? 'true' : 'false' ,
135135
...routesShard,
136136
])
137137
.on('message', data => {

modules/common/engine/src/inline-css-processor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class CrittersExtended extends Critters {
4040
mergeStylesheets: false,
4141
preload: 'media',
4242
noscriptFallback: true,
43+
inlineFonts: true,
4344
// Cast any is needed because of logger API is not exposed as part of the options
4445
// https://github.com/GoogleChromeLabs/critters/issues/66
4546
// tslint:disable-next-line: no-any

0 commit comments

Comments
 (0)