Jason Miller

Results 1189 comments of Jason Miller

I can confirm, this is still an issue in `[email protected]`: ```js import Critters from 'critters'; setTimeout(async () => { const assets = { '/test.css': 'body, html, div, p { margin:...

IIRC @janicklas-ralph has done some experimenting to improve performance for this use-case. It's a trade-off though, and any caching would need to be controllable by the caller.

In general, `pruneSource` can't be used with multi-page sites, since it either over-prunes for some pages or produces one CSS file per-page. My recommendation has generally been to use `pruneSource:false`...

For now, we can do a simple check both [here](https://github.com/GoogleChromeLabs/critters/blob/af32e21f40ea815fd0fa68990bba3e22a503c7d0/src/index.js#L262) and [here](https://github.com/GoogleChromeLabs/critters/blob/af32e21f40ea815fd0fa68990bba3e22a503c7d0/src/index.js#L387), as well as [here where we filter the rules](https://github.com/GoogleChromeLabs/critters/blob/af32e21f40ea815fd0fa68990bba3e22a503c7d0/src/index.js#L456): ```diff + // print styles are not considered critical....

I'd actually generally recommend turning `pruneSource` off, regardless of this bug. Pruning source CSS in a multipage website can be really bad for caching and occasionally fails entirely. If each...

I've run into this as well in the past week.

It looks like we'll need to bring back the option of running stylesheets through cssnano.

Ahh, good catch. We can definitely get this fixed, I'm now working part-time on a windows machine so its easier to test. It looks like most of the path manipulation...

Nice catch! I always use publicPath since without it, client-side routing breaks resource paths. This should be pretty simple to fix.

@hiepxanh best thing to do would be to check for an update in the `css-select` npm module, which is what Critters uses to parse selectors.