-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostcss.config.mjs
42 lines (38 loc) · 1.03 KB
/
postcss.config.mjs
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
import autoprefixer from "autoprefixer";
import cssnano from "cssnano";
import removeComments from "postcss-discard-comments";
import postcssPresetEnv from "postcss-preset-env";
export default {
plugins: [
// https://github.com/postcss/autoprefixer
autoprefixer({
env: process.env.HUGO_ENVIRONMENT,
remove: false,
ignoreUnknownVersions: true,
grid: true,
}),
// https://www.npmjs.com/package/postcss-preset-env
postcssPresetEnv({
stage: 2,
minimumVendorImplementations: 2,
env: process.env.HUGO_ENVIRONMENT,
features: {
"nesting-rules": true,
},
debug: process.env.HUGO_ENVIRONMENT !== "debug" ? false : true,
autoprefixer: {
grid: true,
},
}),
// https://www.npmjs.com/package/postcss-discard-comments
removeComments({
removeAll: true,
}),
// https://cssnano.github.io/cssnano
cssnano({
preset: [
process.env.HUGO_ENVIRONMENT !== "development" ? "advanced" : "lite",
],
}),
],
};