#Page not loading styles after using astrp-purgecss

3 messages · Page 1 of 1 (latest)

indigo oracle
#
  1. after local build and preview, the style can be loaded normally
  2. after deploying on VPS, it can't be loaded.
chrome gullBOT
#

Hi @indigo oracle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information about issues with styles not loading after using astro-purgecss or deploying on a VPS.

However, Astro does provide some guidance on how styles are handled. When Astro builds your site for production deployment, it minifies and combines your CSS into chunks. Each page on your site gets its own chunk, and additionally, CSS that is shared between multiple pages is further split off into their own chunks for reuse. You can configure the size at which stylesheets will be linked externally (in bytes) using the assetsInlineLimit vite build option. Note that this option affects script and image inlining as well. If you would rather all project styles remain external, you can configure the inlineStylesheets build option. You can also set this option to 'always' which will inline all stylesheets. source (https://docs.astro.build/en/guides/styling/#production)

If you're still having trouble, I recommend checking the Astro documentation (https://docs.astro.build/) or reaching out to the Astro community for more specific guidance.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: