MadeByMike/supermaya

Critical CSS fails on WSL

Closed this issue · 2 comments

if criticalCSS: true in site.js builds will fail on at least WSL due to Puppeteer issues. Likewise, on Netlify the build will just return a single "undefined" and pass the build.

So, I don't know if the Critical CSS script is broken or if it's just the stack that doesn't work.

@httpsterio Puppeteer can be tricky to install on WSL puppeteer/puppeteer#1837

I'd recommend turning it off on dev and running it only in production like this:

criticalCSS: process.env.NODE_ENV === "production",

See:
https://github.com/MadeByMike/madebymike/blob/master/site/_data/site.js

WSL2 is landing soon for me so I'll test if I can get Puppeteer up and running, but yeah, setting the process.env as such would work. I'll close for now :)