Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forceExclude is ignored / not working #355

Open
brice-j opened this issue Feb 23, 2023 · 0 comments
Open

forceExclude is ignored / not working #355

brice-j opened this issue Feb 23, 2023 · 0 comments

Comments

@brice-j
Copy link

brice-j commented Feb 23, 2023

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant