Skip to content

Commit

Permalink
feat(types): allow autocomplete for target (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLunaHey committed Feb 7, 2023
1 parent a2803dd commit 6f059ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export type BannerOrFooter =
}
| ((ctx: { format: Format }) => { js?: string; css?: string } | undefined)

type Autocomplete<Keys extends string> = Keys | Omit<string, Keys>;
export type BrowserTarget = 'chrome' | 'deno' | 'edge' | 'firefox' | 'hermes' | 'ie' | 'ios' | 'node' | 'opera' | 'rhino' | 'safari';
export type EsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
export type Target = Autocomplete<BrowserTarget | EsTarget>;

/**
* The options available in tsup.config.ts
* Not all of them are available from CLI flags
Expand All @@ -64,7 +69,7 @@ export type Options = {
*
* default to `node14`
*/
target?: string | string[]
target?: Target | Target[]
minify?: boolean
minifyWhitespace?: boolean
minifyIdentifiers?: boolean
Expand Down

1 comment on commit 6f059ee

@vercel
Copy link

@vercel vercel bot commented on 6f059ee Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.