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

[question] can we run critters after export? #42

Open
tuananh opened this issue Sep 17, 2018 · 6 comments
Open

[question] can we run critters after export? #42

tuananh opened this issue Sep 17, 2018 · 6 comments
Labels
question Item is a question, not an issue

Comments

@tuananh
Copy link

tuananh commented Sep 17, 2018

From what I observe, pwa export will use chrome to pre-render all pages (default) with css classes and everything. So running critter after this point make more sense right?

@lukeed
Copy link
Owner

lukeed commented Sep 17, 2018

Hey, we can only run Critters within the build process. There's no other place to put it since it's a webpack plugin.

Were you seeing an issue? Why do you think it should be elsewhere?

@lukeed lukeed added the question Item is a question, not an issue label Sep 17, 2018
@tatchi
Copy link

tatchi commented Sep 17, 2018

Hey,

What about using prerender-loader to produce the HTML files ? Would it be a good idea?

Furthermore, the critters github page says:

Critters' design makes it a good fit when inlining critical CSS for prerendered/SSR'd Single Page Applications. It was developed to be an excellent compliment to prerender-loader, combining to dramatically improve first paint time for most Single Page Applications.

@lukeed
Copy link
Owner

lukeed commented Sep 17, 2018

You can use prerender-loader instead of pwa export, though I don't know why you would since it's the same functionality. You'd have to configure it manually inside your pwa.config.js which would be easy.

Critters already works, as is, with pwa build and pwa export. This is why it's included as an official plugin :) Are you guys having issues with it?

You can verify it's working by viewing the source of your built pages. A lot of CSS will be inlined in the <head> of your page(s).

@tuananh
Copy link
Author

tuananh commented Sep 17, 2018

@lukeed it seems the css generated by critters is not all the critical css. i will try to make a minimal example to reproduce it.

@lukeed
Copy link
Owner

lukeed commented Sep 17, 2018

Great, thanks! If that's the case, it's likely an issue with Critters itself, but I'm happy to take a look & pass it along to Critters if needed.

@tatchi
Copy link

tatchi commented Sep 18, 2018

Hey,

Thanks for the answer :) I personally don't have any issue with the pwa export functionality. I just had the impression that the export was done more or less manually (with the chrome-launcher). Since a webpack plugin can achieve the same result, I was just wondering if it would be a good idea to use it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Item is a question, not an issue
Projects
None yet
Development

No branches or pull requests

3 participants