-
Notifications
You must be signed in to change notification settings - Fork 2
/
postcss.config.js
48 lines (45 loc) · 1.38 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
module.exports = {
plugins: [
"postcss-import",
"tailwindcss",
process.env.NODE_ENV === "production"
? [
"@fullhuman/postcss-purgecss",
{
content: [
"./pages/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./public/index.html"
],
css: ["./css/tailwind.css"],
// eslint-disable-next-line security/detect-unsafe-regex
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
}
]
: undefined,
"autoprefixer",
"postcss-preset-env",
"cssnano"
]
};
// // medium.com/@xijo/create-react-app-with-tailwind-via-postcss-plus-purgecss-5c36b4c33ba7
// const purgecss = require("@fullhuman/postcss-purgecss")({
// content: [
// "./pages/**/*.{js,jsx,ts,tsx}",
// "./components/**/*.{js,jsx,ts,tsx}",
// "./public/index.html"
// ],
// css: ["./css/tailwind.css"],
// // Include any special characters you're using in this regular expression
// defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
// });
// //postcss.config.js
// const tailwindcss = require("tailwindcss");
// module.exports = {
// plugins: [
// tailwindcss("./tailwind.config.js"),
// "autoprefixer",
// ...(process.env.NODE_ENV === "production" ? [purgecss] : []),
// "cssnano"
// ]
// };