Skip to content

Commit 00dc3d4

Browse files
committed
fix: #22 tsd type error
1 parent 3083b0a commit 00dc3d4

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

apps/vite-vue/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export default defineConfig({
1313
return defaultMangleClassFilter(className)
1414
},
1515
classSetOutput: true,
16-
classMapOutput: true
16+
classMapOutput: true,
17+
jsHandlerOptions: {
18+
minified: true
19+
}
1720
})
1821
]
1922
})

packages/unplugin-tailwindcss-mangle/src/types.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
ClassGenerator,
2+
IHandlerOptions,
33
IHtmlHandlerOptions, // as InternalHtmlHandlerOptions,
44
IJsHandlerOptions, // as InternalJsHandlerOptions,
55
ICssHandlerOptions // as InternalCssHandlerOptions
@@ -15,11 +15,6 @@ export interface IClassGeneratorOptions {
1515
classPrefix?: string
1616
}
1717

18-
export interface IHandlerOptions {
19-
runtimeSet: Set<string>
20-
classGenerator: ClassGenerator
21-
}
22-
2318
export interface ClassSetOutputOptions {
2419
filename: string
2520
dir?: string
@@ -30,14 +25,17 @@ export interface ClassMapOutputOptions {
3025
filename: string
3126
dir?: string
3227
}
28+
29+
export type PartialHandlerOptions<T extends IHandlerOptions> = Partial<Omit<T, 'runtimeSet' | 'classGenerator'>>
30+
3331
export interface Options {
3432
mangleClassFilter?: (className: string) => boolean
3533
classGenerator?: IClassGeneratorOptions
3634
exclude?: string[]
3735
include?: string[]
3836
classSetOutput?: boolean | ClassSetOutputOptions
3937
classMapOutput?: boolean | ClassMapOutputOptions
40-
htmlHandlerOptions?: IHtmlHandlerOptions
41-
jsHandlerOptions?: IJsHandlerOptions
42-
cssHandlerOptions?: ICssHandlerOptions
38+
htmlHandlerOptions?: PartialHandlerOptions<IHtmlHandlerOptions>
39+
jsHandlerOptions?: PartialHandlerOptions<IJsHandlerOptions>
40+
cssHandlerOptions?: PartialHandlerOptions<ICssHandlerOptions>
4341
}

0 commit comments

Comments
 (0)