-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.js
More file actions
35 lines (32 loc) · 908 Bytes
/
postcss.config.js
File metadata and controls
35 lines (32 loc) · 908 Bytes
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
// Autoprefix css rules
const autoprefixer = require("autoprefixer");
// minimize CSS
const cssnano = require("cssnano");
// Purge unused CSS
const purgecss = require("@fullhuman/postcss-purgecss");
// for browser support list, see browserslist in package.json
module.exports = {
plugins: [
// Remove unused CSS
purgecss({
content: ["./src/**/*.njk", "./src/**/*.ts", "./src/**/*.tsx"],
variables: true,
safelist: {
greedy: [/^splide/],
},
}),
autoprefixer,
cssnano({
preset: [
"default",
{
discardComments: { removeAll: true }, // Remove all comments
mergeRules: true, // Merge CSS rules
normalizeWhitespace: true, // Reduce whitespace in CSS
mergeIdents: true, // Reduce CSS selectors
reduceIdents: false, // Don't change CSS selector names
},
],
}),
],
};