Skip to content

Commit

Permalink
Docs: build.target: Terser < 5.16 specific behavior
Browse files Browse the repository at this point in the history
Updated docs after vitejs#12197: `build.target` is overridden to `'es2021'` for installed Terser versions below 5.16.0 only.
  • Loading branch information
laurentpayot committed Mar 21, 2023
1 parent 33baff5 commit 2f99b94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Browser compatibility target for the final bundle. The default value is a Vite s

Another special value is `'esnext'` - which assumes native dynamic imports support and will transpile as little as possible:

- If the [`build.minify`](#build-minify) option is `'terser'`, `'esnext'` will be forced down to `'es2021'`.
- If the [`build.minify`](#build-minify) option is `'terser'` and the installed Terser version is below 5.16.0, `'esnext'` will be forced down to `'es2021'`.
- In other cases, it will perform no transpilation at all.

The transform is performed with esbuild and the value should be a valid [esbuild target option](https://esbuild.github.io/api/#target). Custom targets can either be an ES version (e.g. `es2015`), a browser with version (e.g. `chrome58`), or an array of multiple target strings.
Expand Down

0 comments on commit 2f99b94

Please sign in to comment.