File tree Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " tailwindcss-patch " : patch
3
+ " @tailwindcss-mangle/config " : patch
4
+ ---
5
+
6
+ chore: export type and add tailwindcss version config
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ export interface TailwindcssV4PatchConfig {
46
46
cssEntries ?: string [ ]
47
47
}
48
48
49
+ export interface TailwindcssUserConfig {
50
+ version ?: 2 | 3 | 4
51
+ // only support jit mode
52
+ v2 ?: TailwindcssV2PatchConfig
53
+ v3 ?: TailwindcssV3PatchConfig
54
+ v4 ?: TailwindcssV4PatchConfig
55
+ }
56
+
49
57
export interface PatchUserConfig {
50
58
output ?: {
51
59
filename ?: string
@@ -56,12 +64,7 @@ export interface PatchUserConfig {
56
64
*/
57
65
removeUniversalSelector ?: boolean
58
66
}
59
- tailwindcss ?: {
60
- // only support jit mode
61
- v2 ?: TailwindcssV2PatchConfig
62
- v3 ?: TailwindcssV3PatchConfig
63
- v4 ?: TailwindcssV4PatchConfig
64
- }
67
+ tailwindcss ?: TailwindcssUserConfig
65
68
}
66
69
67
70
export interface UserConfig {
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ export class TailwindcssPatcher {
39
39
if ( packageInfo . version ) {
40
40
this . majorVersion = Number . parseInt ( packageInfo . version [ 0 ] )
41
41
}
42
+ if ( this . patchOptions . tailwindcss ?. version ) {
43
+ this . majorVersion = this . patchOptions . tailwindcss . version
44
+ }
42
45
this . packageInfo = packageInfo
43
46
this . patch = ( ) => {
44
47
try {
Original file line number Diff line number Diff line change 1
1
/* eslint-disable ts/no-unsafe-function-type */
2
- import type { PatchUserConfig } from '@tailwindcss-mangle/config'
2
+ import type { PatchUserConfig , TailwindcssUserConfig } from '@tailwindcss-mangle/config'
3
3
import type { PackageJson } from 'pkg-types'
4
4
import type { Node , Rule } from 'postcss'
5
5
import type { Config } from 'tailwindcss'
6
6
7
7
export type CacheStrategy = 'merge' | 'overwrite'
8
8
9
+ export type {
10
+ TailwindcssUserConfig ,
11
+ }
12
+
9
13
export interface PackageInfo {
10
14
name : string
11
15
version : string | undefined
You can’t perform that action at this time.
0 commit comments