File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,12 @@ const normalizeOptions = async (
56
56
}
57
57
const options : Buildable < NormalizedOptions > = {
58
58
target : 'node14' ,
59
- format : [ 'cjs' ] ,
60
59
outDir : 'dist' ,
61
60
..._options ,
61
+ format :
62
+ typeof _options . format === 'string'
63
+ ? [ _options . format as Format ]
64
+ : _options . format || [ 'cjs' ] ,
62
65
dts :
63
66
typeof _options . dts === 'boolean'
64
67
? _options . dts
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export type Options = {
72
72
jsxFragment ?: string
73
73
outDir ?: string
74
74
outExtension ?: OutExtensionFactory
75
- format ?: Format [ ]
75
+ format ?: Format [ ] | string
76
76
globalName ?: string
77
77
env ?: {
78
78
[ k : string ] : string
@@ -176,10 +176,11 @@ export type Options = {
176
176
}
177
177
178
178
export type NormalizedOptions = Omit <
179
- MarkRequired < Options , 'entry' | 'format' | ' outDir'> ,
180
- 'dts'
179
+ MarkRequired < Options , 'entry' | 'outDir' > ,
180
+ 'dts' | 'format'
181
181
> & {
182
182
dts ?: DtsConfig
183
183
tsconfigResolvePaths : Record < string , string [ ] >
184
184
tsconfigDecoratorMetadata ?: boolean
185
+ format : Format [ ]
185
186
}
You can’t perform that action at this time.
0 commit comments