Skip to content

Commit df92cc2

Browse files
committed
Remove cleanCSS from cleaning and minifying the css of pre warm asset file
1 parent f08c8d8 commit df92cc2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dotcom-rendering/src/server/handler.assets.apps.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createHash } from 'node:crypto';
22
import { isString } from '@guardian/libs';
3-
import CleanCSS from 'clean-css';
43
import { type RequestHandler } from 'express';
54
import { renderToString } from 'react-dom/server';
65
import { generateScriptTags, getPathFromManifest } from '../lib/assets';
@@ -25,10 +24,6 @@ type Props = {
2524
};
2625

2726
export const buildHtml = (scriptTags: string[]) => {
28-
const fontAssetsCss = new CleanCSS()
29-
.minify(rawFontsCssWithClassNames)
30-
.styles.trim();
31-
3227
const body = renderToString(<AssetsPage fontList={fontList} />);
3328

3429
return `<!doctype html>
@@ -38,11 +33,11 @@ export const buildHtml = (scriptTags: string[]) => {
3833
<meta charset='utf-8'>
3934
4035
<style>
41-
${fontAssetsCss}
36+
${rawFontsCssWithClassNames}
4237
</style>
4338
4439
<meta http-equiv='Content-Security-Policy' content="style-src 'sha256-${assetHash(
45-
fontAssetsCss,
40+
rawFontsCssWithClassNames,
4641
)}';">
4742
4843
${scriptTags.join('\n')}

0 commit comments

Comments
 (0)