Files
blog_legacy/postcss.config.js
Dave 6f0b2fd016
All checks were successful
Build and Deploy Astro Site / deploy (push) Successful in 54s
Fixed overeager purgecss
2025-09-10 00:19:07 +02:00

44 lines
955 B
JavaScript

// postcss.config.js
import { purgeCSSPlugin } from '@fullhuman/postcss-purgecss'
import postcssApply from 'postcss-apply'
import postcssEasing from 'postcss-easings'
import postcssImport from 'postcss-import'
import postcssMixins from 'postcss-mixins'
import postcssNesting from 'postcss-nesting'
import postcssPresetEnv from 'postcss-preset-env'
import postcssUtilities from 'postcss-utilities'
const plugins = [
postcssImport(),
postcssApply(),
postcssMixins(),
postcssEasing(),
postcssPresetEnv({
stage: 1,
features: {
'nesting-rules': false,
},
}),
postcssUtilities(),
postcssNesting(),
]
if (process.env.NODE_ENV === 'production') {
console.log('Adding PurgeCSS')
plugins.push(
purgeCSSPlugin({
content: [
'./src/**/*.{html,js,jsx,ts,tsx,css}',
'./content/**/*.{md,mdx}',
],
safelist: ['html', 'body'],
variables: true,
})
)
}
export default {
plugins,
}