-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostcss.config.js
37 lines (30 loc) · 986 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
34
35
36
37
// @see https://github.com/postcss/postcss-loader#configuration
// Package modules.
const atImport = require('postcss-import');
const reporter = require('postcss-reporter');
const url = require('postcss-url');
const stylelint = require('stylelint');
const tailwind = require('tailwindcss');
const tailwindNesting = require('@tailwindcss/nesting');
// Exports.
module.exports = ({ cwd }) => {
// Build list of plugins.
const plugins = [
stylelint(),
atImport({
plugins: [
// https://stylelint.io/user-guide/usage/postcss-plugin
stylelint(),
// Rebase asset URLs to work after inlining imported file.
// https://github.com/postcss/postcss-import/blob/master/README.md
url({ assetsPath: cwd }),
],
}),
// https://tailwindcss.com/docs/using-with-preprocessors#nesting
tailwindNesting(),
tailwind(),
reporter({ clearReportedMessages: true }),
];
// Return configuration.
return { plugins };
};