-
Notifications
You must be signed in to change notification settings - Fork 0
/
postcss.config.js
53 lines (46 loc) · 1.05 KB
/
postcss.config.js
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
48
49
50
51
52
53
// SPDX-FileCopyrightText: 2024 Mischback
// SPDX-License-Identifier: MIT
// SPDX-FileType: SOURCE
//
/**
* Configuration for ``PostCSS``.
*
* The SCSS sources are transpiled using ``sass`` and the result is then
* post-processed with PostCSS.
*/
const purgecss = require("@fullhuman/postcss-purgecss")({
content: ["./.build/**/*.html"],
fontFace: true,
keyFrames: true,
rejected: true,
variables: true,
safelist: [],
blocklist: [],
});
const reporter = require("postcss-reporter")({
filter: function (msg) {
return true;
},
clearAllMessages: true,
});
/* Determine if we're running in *development mode*.
*
* See the ``Makefile`` for the value of the *development flag*.
*/
const devMode = process.env.DEV_FLAG === "dev";
/* The default output format.
*
* *development mode* will skip all optimisation plugins.
*/
const config = {
plugins: [
purgecss,
require("autoprefixer")(),
require("cssnano")(),
reporter,
],
};
if (devMode === true) {
config.plugins = [purgecss, reporter];
}
module.exports = config;