-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
config.ts
38 lines (36 loc) · 1.14 KB
/
config.ts
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
import type { UserDefinedOptions } from '@fullhuman/postcss-purgecss'
export interface ModuleOptions extends UserDefinedOptions {
enabled?: boolean,
}
export const DEFAULTS: ModuleOptions = {
content: [
'components/**/*.{vue,jsx?,tsx?}',
'layouts/**/*.{vue,jsx?,tsx?}',
'pages/**/*.{vue,jsx?,tsx?}',
'composables/**/*.{vue,jsx?,tsx?}',
'App.{vue,jsx?,tsx?}',
'app.{vue,jsx?,tsx?}',
'plugins/**/*.{js,ts}',
'nuxt.config.{js,ts}'
],
defaultExtractor: (content) => {
const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '') // Remove inline vue styles
return contentWithoutStyleBlocks.match(/[\w-.:/]+(?<!:)/g) || [] // Default extractor
},
// Adapted from https://purgecss.com/guides/vue.html#usage
safelist: [
'body',
'html',
'nuxt-progress',
'__nuxt',
/-(leave|enter|appear)(|-(to|from|active))$/, // Normal transitions
/^nuxt-link(|-exact)-active$/, // Nuxt link classes
/^(?!cursor-move).+-move$/, // Move transitions
/.*data-v-.*/, // Keep scoped styles
// New Vue3 selectors
/:slotted/,
/:deep/,
/:global/,
/nuxt-devtools-.*/
]
}