File tree Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 1
1
import type { FilterPattern } from '@rollup/pluginutils'
2
2
import type { IClassGeneratorOptions } from '@tailwindcss-mangle/shared'
3
-
3
+ import type { PackageResolvingOptions } from 'local-pkg'
4
4
export interface ClassMapOutputOptions {
5
5
enable ?: boolean
6
6
filename ?: string
@@ -54,17 +54,21 @@ export interface TailwindcssUserConfig {
54
54
v4 ?: TailwindcssV4PatchConfig
55
55
}
56
56
57
- export interface PatchUserConfig {
58
- output ?: {
59
- filename ?: string
57
+ export interface OutputUserConfig {
58
+ filename ?: string
60
59
61
- loose ?: boolean
62
- /**
63
- * @description remove * in output json
64
- */
65
- removeUniversalSelector ?: boolean
66
- }
60
+ loose ?: boolean
61
+ /**
62
+ * @description remove * in output json
63
+ */
64
+ removeUniversalSelector ?: boolean
65
+ }
66
+
67
+ export interface PatchUserConfig {
68
+ packageName ?: string
69
+ output ?: OutputUserConfig
67
70
tailwindcss ?: TailwindcssUserConfig
71
+ resolve ?: PackageResolvingOptions
68
72
}
69
73
70
74
export interface UserConfig {
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ export class TailwindcssPatcher {
30
30
31
31
this . cacheManager = new CacheManager ( this . cacheOptions )
32
32
33
- const packageInfo = getPackageInfoSync ( 'tailwindcss' )
33
+ const packageInfo = getPackageInfoSync (
34
+ this . patchOptions . packageName ?? 'tailwindcss' ,
35
+ this . patchOptions . resolve ,
36
+ )
34
37
35
38
if ( ! packageInfo ) {
36
39
throw new Error ( 'tailwindcss not found' )
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { defu } from '@tailwindcss-mangle/shared'
4
4
5
5
export function getDefaultPatchOptions ( ) : DeepRequired < PatchOptions > {
6
6
return {
7
+ packageName : 'tailwindcss' ,
7
8
applyPatches : {
8
9
exportContext : true ,
9
10
extendLengthUnits : false ,
Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ exports[`defaults > getDefaultPatchOptions 1`] = `
7
7
" extendLengthUnits" : false ,
8
8
},
9
9
" overwrite" : true ,
10
+ " packageName" : " tailwindcss" ,
10
11
}
11
12
` ;
You can’t perform that action at this time.
0 commit comments