orbit
orbit copied to clipboard
[astro-purgecss] No way to config Astro SSR
Describe the bug In the README it says:
If you are using Astro SSR in your project, you must add your astro and framework sources files into the content option (see in the example).
But there is no example, and without it CSS files aren't working at all when building an app using Astro SSR. What is content supposed to be set to?
I admit the SSR setup for this package is a bit rough, it’s not well-documented.
Technically, you need to tell PurgeCSS which files to scan so it can detect which classes are actually used and which ones to remove.
export default defineConfig({
integrations: [
purgecss({
content: ['./src/**/*.astro']
})
]
});
Caveats
- ✅ Recommended: Use external stylesheet files (.css)
- ⚠️ Less Effective: Inline styles in astro files