How to use the critical.css function in critical

To help you get started, we’ve selected a few critical examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cmux / koot / ReactSPA / inject.js View on Github external
styles: (() => {
            let r = ''
            if (typeof filemap['critical.css'] === 'string') {
                if (ENV === 'prod')
                    r += `<style type="text/css" id="__koot-critical-styles">${readClientFile('critical.css', localeId, compilation)}</style>`
                if (ENV === 'dev')
                    r += ``
            }
            return r
        })(),
github cmux / koot / ReactSPA / inject.js View on Github external
styles: (() =&gt; {
            let r = ''
            if (typeof filemap['critical.css'] === 'string') {
                if (ENV === 'prod')
                    r += `<style type="text/css" id="__koot-critical-styles">${readClientFile('critical.css', localeId, compilation)}</style>`
                if (ENV === 'dev')
                    r += ``
            }
            return r
        })(),

critical

Extract & Inline Critical-path CSS from HTML

Apache-2.0
Latest version published 17 days ago

Package Health Score

83 / 100
Full package analysis