-
Notifications
You must be signed in to change notification settings - Fork 0
/
postcss.config.cjs
47 lines (47 loc) · 1.1 KB
/
postcss.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const purgecss = require("@fullhuman/postcss-purgecss")({
content: ['./public/**/*',
'./src/**/*.{astro,js,jsx,ts,tsx,vue}'],
options: {
safelist: [/^body/, /^html/, /^dark/, "dark", "html", "body", /^light/, "light"]
},
fontFace: true,
keyframes: true,
variables: true,
rejected: true
});
const cssnano = require("cssnano")({
preset: [
"default",
{
cssDeclarationSorter: true,
discardEmpty: true,
discardOverridden: true,
discardDuplicates: true,
discardComments: true,
mergeIdents: true,
mergeLonghand: true,
mergeRules: false,
minifySelectors: true,
minifyParams: true,
minifyGradients: true,
minifyFontValues: true,
normalizeWhitespace: true,
normalizePositions: true,
normalizeUrl: true,
normalizeDisplayValues: true,
reducetransforms: true,
reduceIdents: true,
uniqueSelectors: true,
},
],
});
module.exports = {
plugins: [
require("postcss-mixins"),
require("postcss-import"),
require("postcss-nested"),
require("autoprefixer"),
cssnano,
...(process.env.NODE_ENV === "production" ? [purgecss] : []),
],
};