File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
import type { IClassGeneratorOptions , IClassGenerator } from './types'
2
2
3
+ export const preserveClassNames = [
4
+ // https://tailwindcss.com/docs/transition-timing-function start
5
+ // https://github.com/sonofmagic/tailwindcss-mangle/issues/21
6
+ 'ease-out' ,
7
+ 'ease-linear' ,
8
+ 'ease-in' ,
9
+ 'ease-in-out'
10
+ // https://tailwindcss.com/docs/transition-timing-function end
11
+ ]
12
+
13
+ // eslint-disable-next-line unicorn/no-array-reduce
14
+ const preserveClassNamesMap = preserveClassNames . reduce < Record < ( typeof preserveClassNames ) [ number ] , true > > ( ( acc , cur ) => {
15
+ acc [ cur ] = true
16
+ return acc
17
+ } , { } )
18
+
3
19
export const defaultMangleClassFilter = ( className : string ) => {
20
+ if ( preserveClassNamesMap [ className ] ) {
21
+ return false
22
+ }
4
23
// ignore className like 'filter','container'
5
24
// it may be dangerous to mangle/rename all StringLiteral , so use /-/ test for only those with /-/ like:
6
25
// bg-[#123456] w-1 etc...
You can’t perform that action at this time.
0 commit comments