Skip to content

Commit

Permalink
build(astro): update purgecss syntax
Browse files Browse the repository at this point in the history
Many of the safelist selectors are nested among other selectors so want to use greedy rather than standard matching.
  • Loading branch information
Zweihander-Main committed Sep 17, 2024
1 parent c24f66d commit 4a73f56
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import purgecss from 'astro-purgecss';
import sitemap from '@astrojs/sitemap';
import icon from 'astro-icon';

// https://astro.build/config
export default defineConfig({
site: 'https://www.forgingmodernity.com/',
build: {
inlineStylesheets: 'never', // required for purgecss
},
integrations: [
icon({
include: {
Expand All @@ -16,10 +18,12 @@ export default defineConfig({
}),
svelte(),
purgecss({
keyframes: false,
fontFace: false,
variables: true,
safelist: {
standard: [
greedy: [
/.*astro.*/,
/leaflet-pane/,
/leaflet-map/,
/leaflet-control/,
Expand All @@ -29,6 +33,8 @@ export default defineConfig({
/leaflet-left/,
/parchment/,
],
},
content: [process.cwd() + '/src/**/*.{astro,svelte}'],
}),
sitemap(),
],
Expand Down

0 comments on commit 4a73f56

Please sign in to comment.