-
Notifications
You must be signed in to change notification settings - Fork 3
/
purgecss.config.js
43 lines (43 loc) · 1.15 KB
/
purgecss.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
module.exports = {
// Specify the paths to all of your template files
content: [
'./apps/**/src/**/*.{js,jsx,ts,tsx}',
'./apps/**/pages/**/*.{js,jsx,ts,tsx}',
'./apps/**/features/**/*.{js,jsx,ts,tsx}',
'./libs/**/*.{js,jsx,ts,tsx}',
],
// Specify the paths to all of your CSS files
css: [
'./apps/**/src/**/*.css',
'./apps/**/features/**/*.css',
'./apps/**/pages/**/*.css',
'./libs/**/*.css',
],
// CSS files to write the purged CSS to
output: (filepath) => {
// Return the same path as the source file
return filepath
},
// Options for PurgeCSS
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
safelist: {
standard: [
// Add classes that are dynamically created
/^recharts-/, // For recharts classes
/^print-/, // For print-related classes
/^sticky/, // For sticky classes
/^active/, // For active states
/^disabled/, // For disabled states
],
deep: [
// Add classes that include other classes
/^tooltip/,
/^modal/,
],
greedy: [
// Add classes with certain patterns
/^data-/,
/^react-/,
],
},
}