penthouse icon indicating copy to clipboard operation
penthouse copied to clipboard

forceExclude is ignored / not working

Open brice-j opened this issue 2 years ago • 0 comments

Hello,

I'm using [email protected] and it seems forceExclude never works forceInclude works perfectly however. I don't see what I'm doing wrong...

This is how I implemented it, has anyone encountered similar issues with this option ?

function runPenthouse(templateName, urlToScan){
	return gulp.src('./style.css').pipe(criticalCss({        	
        out: '-' + templateName + '-critical.css', // output file name
        url:  urlToScan, // url from where we want penthouse to extract critical styles
        width: 1400, // max window width for critical media queries
        height: 2000, // max window height for critical media queries
        forceExclude: ['.testimonial-card-img'],
        userAgent: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' // pretend to be googlebot when grabbing critical page styles.
    }))        
    .pipe(cleanCSS())
    .pipe(gulp.dest('./assets/critical-css/css/'))
    .on('end', function() {
    	counter.current+=1;
    	if(counter.current < counter.max ){
    		generateCriticalCss(pages[counter.current]);
    	}    
    });
}

Greetings,

brice-j avatar Feb 23 '23 13:02 brice-j