File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
dotcom-rendering/src/server Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 11import { createHash } from 'node:crypto' ;
22import { isString } from '@guardian/libs' ;
3- import CleanCSS from 'clean-css' ;
43import { type RequestHandler } from 'express' ;
54import { renderToString } from 'react-dom/server' ;
65import { generateScriptTags , getPathFromManifest } from '../lib/assets' ;
@@ -25,10 +24,6 @@ type Props = {
2524} ;
2625
2726export 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' ) }
You can’t perform that action at this time.
0 commit comments