Gatsby: CSS on Gatsby site loading late, hosted on Netlify

Created on 27 Jun 2018  路  2Comments  路  Source: gatsbyjs/gatsby

If you go to https://enlight.nyc, the page will take a really long time to load the CSS. I think I'm doing something wrong with the optimization of the site.

Here's the GitHub repo: https://github.com/TryEnlight/site

I tried to load the components before the css, but I still don't see any changes. The site is hosted on Netlify and is fast when I serve locally.

I'd appreciate any insights to solve this problem. Thank you!

Most helpful comment

You need to add https://www.gatsbyjs.org/packages/gatsby-plugin-styled-components/?=styled so that your styles are extracted during the build and added to the generated HTML files.

Good luck!

All 2 comments

You need to add https://www.gatsbyjs.org/packages/gatsby-plugin-styled-components/?=styled so that your styles are extracted during the build and added to the generated HTML files.

Good luck!

Thanks so much for this answer @KyleAMathews. Found this while googling trying to solve the same issue and it worked :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ferMartz picture ferMartz  路  3Comments

brandonmp picture brandonmp  路  3Comments

hobochild picture hobochild  路  3Comments

andykais picture andykais  路  3Comments

benstr picture benstr  路  3Comments