forked from UTCWeb/particle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.js
More file actions
27 lines (25 loc) · 809 Bytes
/
Copy pathpostcss.config.js
File metadata and controls
27 lines (25 loc) · 809 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
/**
* PostCSS config
*/
const postcssPresetEnv = require('postcss-preset-env');
const cssnano = require('cssnano');
const tailwindcss = require('tailwindcss');
const hexrgba = require('postcss-hexrgba');
const stylelint = require('stylelint');
const postcssReporter = require('postcss-reporter');
module.exports = ({ options, env }) => {
return {
plugins: [
stylelint(),
// tailwindConfig is set per *design system* webpack.config.js.
options.tailwindConfig && tailwindcss(options.tailwindConfig),
// Hex in rgba like Sass
hexrgba(),
// Use .browserslistrc to determine CSS mutations
postcssPresetEnv(),
// Heavy processing for production
env === 'production' && cssnano(),
postcssReporter({ clearReportedMessages: true }),
],
};
};