Files
blog_legacy/postcss.config.js
Dave 88b9beb19f
Some checks failed
Build and Deploy Astro Site / deploy (push) Failing after 29s
Remove variable purging from purgecss
2025-09-10 09:37:51 +02:00

44 lines
1001 B
JavaScript

// postcss.config.js
import { purgeCSSPlugin } from '@fullhuman/postcss-purgecss'
import glob from 'glob-all'
import path from 'path'
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') {
plugins.push(
purgeCSSPlugin({
content: glob.sync([
path.join(process.cwd(), 'src/**/*.{js,jsx,ts,tsx}'),
path.join(process.cwd(), 'content/**/*.{md,mdx}'),
]),
safelist: ['html', 'body'],
})
)
}
export default {
plugins,
}