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

Commit cecd5bd

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 (cherry picked from commit dbad8e9)
1 parent 053e69a commit cecd5bd

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
@@ -41,6 +41,7 @@ class CrittersExtended extends Critters {
4141
mergeStylesheets: false,
4242
preload: 'media',
4343
noscriptFallback: true,
44+
inlineFonts: true,
4445
// Cast any is needed because of logger API is not exposed as part of the options
4546
// https://github.com/GoogleChromeLabs/critters/issues/66
4647
// tslint:disable-next-line: no-any

0 commit comments

Comments
 (0)