Skip to content

Commit

Permalink
refactor!: bump minimal terser version to 5.16.0
Browse files Browse the repository at this point in the history
resolve #1642

vitejs/vite@19ce525 の反映です。
  • Loading branch information
shuuji3 committed Oct 23, 2024
1 parent f2a2647 commit ef1371c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

最終的なバンドルのブラウザー互換性のターゲット。デフォルトは Vite の特別な値 `'modules'` で、これは[ネイティブ ES モジュール](https://caniuse.com/es6-module)[ネイティブ ESM の動的インポート](https://caniuse.com/es6-module-dynamic-import)[`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta)をサポートするブラウザーを対象にします。Vite は `'modules'``['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']` へ置き換えます。

もうひとつの特別な値は `'esnext'` で、これはネイディブの動的インポートをサポートしていることを前提としており、トランスパイルが可能な限り少なくなります:

- [`build.minify`](#build-minify) オプションが `'terser'` で、インストールされている Terser のバージョンが 5.16.0 未満の場合、`'esnext'` は強制的に `'es2021'` に下げられます。
- それ以外の場合、トランスパイルはまったく行なわれません。
もうひとつの特別な値は `'esnext'` で、これはネイディブの動的インポートをサポートしていることを前提としており、最小限のトランスパイルのみが実行されます。

変換は esbuild で実行され、この値は有効な [esbuild の target オプション](https://esbuild.github.io/api/#target)でなければいけません。カスタムターゲットは ES のバージョン(例: `es2015`)、バージョン付きのブラウザー(例: `chrome58`)、または複数のターゲットの文字列の配列を指定できます。

Expand Down

0 comments on commit ef1371c

Please sign in to comment.