-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostcss.config.cjs
36 lines (34 loc) · 1.05 KB
/
postcss.config.cjs
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
const autoprefixer = require("autoprefixer");
const cssnano = require("cssnano");
const tailwindcss = require("tailwindcss");
const postcssImport = require("postcss-import");
const purgecss = require("@fullhuman/postcss-purgecss");
const isProd = process.env.NODE_ENV === "production";
module.exports = {
plugins: [
postcssImport,
tailwindcss,
autoprefixer({
grid: false, // Disable IE support
}),
isProd &&
cssnano({
preset: [
"default",
{
discardComments: {
removeAll: true,
},
},
],
}),
isProd &&
purgecss({
keyframes: true,
content: ["./src/**/*.svelte", "./*.html"],
safelist: [/svelte-/, /tailwindcss\/\/base/],
defaultExtractor: (content) =>
content.match(/[A-Za-z0-9-_:/]+/g) || [],
}),
],
};