-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Description
Defining the following tsup.config.ts
will result in a type error.
import { defineConfig } from "tsup";
import browserslistToEsbuild from "browserslist-to-esbuild";
defineConfig({
target: browserslistToEsbuild(),
})
error:
Type 'string[]' is not assignable to type 'Target | Target[] | undefined'.
Type 'string[]' is not assignable to type 'Target[]'.
Type 'string' is not assignable to type 'Target'.(2322)
This is due to tsup's use of the literal type Union.
Line 88 in 00188a0
export type Target = BrowserTarget | BrowserTargetWithVersion | EsTarget |
Could adding (string & {})
to the type solve this problem?
microsoft/TypeScript#29729 (comment)
Metadata
Metadata
Assignees
Labels
No labels