Last active
January 23, 2023 13:40
-
-
Save jojojojojoj5564656465465/7811cf4d1daa148b9634eaab9bcfb6b2 to your computer and use it in GitHub Desktop.
postcss astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mode = process.env.NODE_ENV; | |
const dev = mode === "development"; | |
// const OpenProps = require('open-props') | |
// const tailwind = require('tailwindcss') | |
// const postcssMediaRanges = require('postcss-media-minmax'); | |
const FontMagician = require("postcss-font-magician"); | |
const PresetEnv = require("postcss-preset-env"); | |
//END PROCESS | |
const purgeCSS = require("@fullhuman/postcss-purgecss"); | |
// FontMagician({ formats: 'woff2 woff' }), | |
// postcssMediaRanges(), | |
// tailwind('./tailwind.config.js'), | |
module.exports = { | |
plugins: [ | |
PresetEnv({ | |
features: { | |
"nesting-rules": true, | |
}, | |
stage: 0, | |
autoprefixer: { | |
cascade: false, | |
grid: false, | |
grid: "autoplace", | |
}, | |
browsers: "last 2 versions", | |
}), | |
!dev && | |
purgeCSS({ | |
content: ["./src/**/*.{astro,svelte,html}"], | |
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [], | |
safelist: ["html", "body"], | |
}), | |
], | |
}; | |
// pad postcss-font-magician @fullhuman/postcss-purgecss postcss-preset-env postcss postcss-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment