How to use the critical.generateInline 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 addyosmani / critical-css-weather-app / gulpfile.js View on Github external
gulp.task('criticalcss', function (cb) {
    critical.generateInline({
        base: './build/',
        src: 'index.html',
        styleTarget: './assets/combined.css',
        htmlTarget: 'index.html',
        width: 960,
        height: 600,
        minify: true
    }, cb.bind(cb));
});

critical

Extract & Inline Critical-path CSS from HTML

Apache-2.0
Latest version published 2 months ago

Package Health Score

81 / 100
Full package analysis