-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostcss.config.js
27 lines (26 loc) · 905 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
const tailwind = require('tailwindcss');
const autoprefixer = require('autoprefixer');
// eslint-disable-next-line import/no-extraneous-dependencies
const nested = require('postcss-nested');
// eslint-disable-next-line import/no-extraneous-dependencies
const postcssPresetEnv = require('postcss-preset-env');
// eslint-disable-next-line import/no-extraneous-dependencies
const purgecss = require('@fullhuman/postcss-purgecss');
// postcss config example from:
// https://tailwindcss.com/docs/controlling-file-size/#setting-up-purgecss
module.exports = {
plugins: [
postcssPresetEnv(),
tailwind,
autoprefixer,
nested,
...(process.env.NODE_ENV === 'production'
? [
purgecss({
content: ['./client/**/*.html', './client/**/*.jsx'],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
}),
]
: []),
],
};