Skip to content
Permalink
Browse files
fix: allow format to be a string in config file
  • Loading branch information
egoist committed Jun 5, 2022
1 parent 90f2d1a commit 0a969854fa76cc671041ffa5e71bfa5aec3a2314
Showing 2 changed files with 8 additions and 4 deletions.
@@ -56,9 +56,12 @@ const normalizeOptions = async (
}
const options: Buildable<NormalizedOptions> = {
target: 'node14',
format: ['cjs'],
outDir: 'dist',
..._options,
format:
typeof _options.format === 'string'
? [_options.format as Format]
: _options.format || ['cjs'],
dts:
typeof _options.dts === 'boolean'
? _options.dts
@@ -72,7 +72,7 @@ export type Options = {
jsxFragment?: string
outDir?: string
outExtension?: OutExtensionFactory
format?: Format[]
format?: Format[] | string
globalName?: string
env?: {
[k: string]: string
@@ -176,10 +176,11 @@ export type Options = {
}

export type NormalizedOptions = Omit<
MarkRequired<Options, 'entry' | 'format' | 'outDir'>,
'dts'
MarkRequired<Options, 'entry' | 'outDir'>,
'dts' | 'format'
> & {
dts?: DtsConfig
tsconfigResolvePaths: Record<string, string[]>
tsconfigDecoratorMetadata?: boolean
format: Format[]
}

0 comments on commit 0a96985

Please sign in to comment.