-
Notifications
You must be signed in to change notification settings - Fork 108
/
postcss.config.js
33 lines (31 loc) · 971 Bytes
/
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
const tailwind = require('tailwindcss');
const purgecss = require('@fullhuman/postcss-purgecss').purgeCSSPlugin;
const cssnano = require('cssnano');
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
plugins: [
tailwind('./tailwind.config.js'),
...(isProduction ? [
purgecss({
content: [
'./server/templates/**/*.html.tmpl',
],
defaultExtractor: content => {
return content.match(/[\w-./]*\w/g) || [];
},
safelist: [
// status classes are dynamically generated
"approved", "disapproved", "pending", "skipped", "error",
// keep all selectors that relate to hidden statuses
"data-next-status", "data-hide-status",
],
}),
cssnano({
preset: ['default', {
// this breaks some tailwind utils, like directional borders
mergeLonghand: false,
}],
}),
] : []),
],
};