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 {
4646 cssEntries ?: string [ ]
4747}
4848
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+
4957export interface PatchUserConfig {
5058 output ?: {
5159 filename ?: string
@@ -56,12 +64,7 @@ export interface PatchUserConfig {
5664 */
5765 removeUniversalSelector ?: boolean
5866 }
59- tailwindcss ?: {
60- // only support jit mode
61- v2 ?: TailwindcssV2PatchConfig
62- v3 ?: TailwindcssV3PatchConfig
63- v4 ?: TailwindcssV4PatchConfig
64- }
67+ tailwindcss ?: TailwindcssUserConfig
6568}
6669
6770export interface UserConfig {
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ export class TailwindcssPatcher {
3939 if ( packageInfo . version ) {
4040 this . majorVersion = Number . parseInt ( packageInfo . version [ 0 ] )
4141 }
42+ if ( this . patchOptions . tailwindcss ?. version ) {
43+ this . majorVersion = this . patchOptions . tailwindcss . version
44+ }
4245 this . packageInfo = packageInfo
4346 this . patch = ( ) => {
4447 try {
Original file line number Diff line number Diff line change 11/* eslint-disable ts/no-unsafe-function-type */
2- import type { PatchUserConfig } from '@tailwindcss-mangle/config'
2+ import type { PatchUserConfig , TailwindcssUserConfig } from '@tailwindcss-mangle/config'
33import type { PackageJson } from 'pkg-types'
44import type { Node , Rule } from 'postcss'
55import type { Config } from 'tailwindcss'
66
77export type CacheStrategy = 'merge' | 'overwrite'
88
9+ export type {
10+ TailwindcssUserConfig ,
11+ }
12+
913export interface PackageInfo {
1014 name : string
1115 version : string | undefined
You can’t perform that action at this time.
0 commit comments