Skip to content

Commit

Permalink
docs: clarify target option, closes egoist#769
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist authored and amitdahan committed Dec 25, 2022
1 parent 71f712b commit 33dda66
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 11 deletions.
21 changes: 20 additions & 1 deletion docs/README.md
Expand Up @@ -290,7 +290,26 @@ Code splitting currently only works with the `esm` output format, and it's enabl
To disable code splitting altogether, try the `--no-splitting` flag instead.
### ES5 support
### Target environment
You can use the `target` option in `tsup.config.ts` or the `--target` flag to set the target environment for the generated JavaScript and/or CSS code. Each target environment is an environment name followed by a version number. The following environment names are currently supported:
- chrome
- edge
- firefox
- hermes
- ie
- ios
- node
- opera
- rhino
- safari
In addition, you can also specify JavaScript language versions such as `es2020`.
The value for `target` defaults to `compilerOptions.target` in your `tsconfig.json`, or `node14` if unspecified. For more information check out esbuild's [target](https://esbuild.github.io/api/#target) option.
#### ES5 support
You can use `--target es5` to compile the code down to es5, in this target your code will be transpiled by esbuild to es2020 first, and then transpiled to es5 by [SWC](https://swc.rs).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -63,7 +63,7 @@
"svelte": "3.46.4",
"ts-essentials": "9.1.2",
"tsconfig-paths": "3.12.0",
"tsup": "6.0.1",
"tsup": "6.4.0",
"typescript": "4.6.3",
"vitest": "0.21.1",
"wait-for-expect": "3.0.2"
Expand Down

0 comments on commit 33dda66

Please sign in to comment.