var critical = require('critical');
critical.generate({
// Inline the generated critical-path CSS
// - true generates HTML
// - false generates CSS
inline: true,
// Your base directory
base: '/var/www/www1/',
// HTML source
html: '<html>...</html>',
// HTML source file
src: 'index.html',
// Your CSS Files (optional)
css: ['/var/www/www1/css/fonts.css',
'/var/www/www1/css/swipper.min.css',
'/var/www/www1/css/youtube-player.css',
'/var/www/www1/css/style.css'],
// Viewport width
width: 1900,
// Viewport height
height: 1200,
// Target for final HTML output.
// use some CSS file when the inline option is not set
dest: 'index-critical.html',
// Minify critical-path CSS when inlining
minify: true,
// Extract inlined styles from referenced stylesheets
extract: true,
// Complete Timeout for Operation
timeout: 30000,
// Prefix for asset directory
pathPrefix: '/MySubfolderDocrot',
// ignore CSS rules
ignore: ['font-face'],
// overwrite default options
ignoreOptions: {}
});