Skip to content

Commit

Permalink
chore(config): 🤖 tweak purgecss config
Browse files Browse the repository at this point in the history
✅ Closes: #90
  • Loading branch information
brklntmhwk committed Nov 12, 2024
1 parent 0a6582d commit 811815e
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import solidJs from '@astrojs/solid-js';
import tailwind from '@astrojs/tailwind';
import purgecss from 'astro-purgecss';
import { defineConfig, passthroughImageService } from 'astro/config';
import browserslist from 'browserslist';
// import browserslist from 'browserslist';
import { h } from 'hastscript';
import { browserslistToTargets } from 'lightningcss';
// import { browserslistToTargets } from 'lightningcss';
import rehypeAutolinkHeadings, {
type Options as RehypeAutoLinkHeadingsOptions,
} from 'rehype-autolink-headings';
Expand Down Expand Up @@ -59,12 +59,20 @@ export default defineConfig({
applyBaseStyles: false,
}),
solidJs(),
purgecss({
fontFace: true,
}),
sitemap(),
iconNameTypes(),
pagefind(),
purgecss({
fontFace: true,
extractors: [
{
// Example using a taiwindcss compatible class extractor
extractor: (content) =>
content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [],
extensions: ['astro', 'html']
}
]
}),
],
prefetch: {
defaultStrategy: 'viewport',
Expand All @@ -83,15 +91,15 @@ export default defineConfig({
css: {
devSourcemap: true,
transformer: 'postcss',
lightningcss: {
cssModules: {
pattern: '[hash]-[local]',
},
drafts: {
customMedia: true,
},
targets: browserslistToTargets(browserslist('>= 0.1%')),
},
// lightningcss: {
// cssModules: {
// pattern: '[hash]-[local]',
// },
// drafts: {
// customMedia: true,
// },
// targets: browserslistToTargets(browserslist('>= 0.1%')),
// },
},
server: {
watch: {
Expand Down

0 comments on commit 811815e

Please sign in to comment.