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
Could adding (string & {})
to the type solve this problem?
microsoft/TypeScript#29729 (comment)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too