-
Notifications
You must be signed in to change notification settings - Fork 1
/
postcss.config.js
53 lines (50 loc) · 1.19 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
49
50
51
52
53
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable import/no-extraneous-dependencies */
const tailwindcss = require('tailwindcss');
const postcssEasyImport = require('postcss-easy-import');
const postcssMixins = require('postcss-mixins');
const postcssPresetEnv = require('postcss-preset-env');
const postcssPurgecss = require('@fullhuman/postcss-purgecss');
const purgecss = postcssPurgecss({
content: [
'./public/**/*.html',
'./src/**/*.vue',
],
css: [
'./src/**/*.css',
],
defaultExtractor: (content) => content.match(/[\w-/:%]+(?<!:)/g) || [],
safelist: {
standard: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!(|.*?:)cursor-move).+-move$/,
/^router-link(|-exact)-active$/,
/data-v-.*/,
/^jtc-.*/,
/^tooltip.*?/,
/^popover.*?/,
],
greedy: [
/^formulate-/,
/^jtc-/,
/tooltip/,
/popover/,
],
},
});
module.exports = {
plugins: [
postcssEasyImport,
postcssMixins,
tailwindcss,
postcssPresetEnv({
stage: 2,
features: {
'nesting-rules': true,
},
}),
...process.env.NODE_ENV === 'production'
? [purgecss]
: [],
],
};