Skip to content

Commit d98b82b

Browse files
authored
feat!: bump build.target and name it baseline-widely-available (#1969)
1 parent ad10ba1 commit d98b82b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

config/build-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
## build.target
66

77
- **型:** `string | string[]`
8-
- **デフォルト:** `'modules'`
8+
- **デフォルト:** `'baseline-widely-available'`
99
- **関連:** [ブラウザーの互換性](/guide/build#browser-compatibility)
1010

11-
最終的なバンドルのブラウザー互換性のターゲット。デフォルトは 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']` へ置き換えます
11+
最終的なバンドルのブラウザー互換性のターゲット。デフォルトは Vite の特別な値 `'baseline-widely-available'` で、これは [Baseline](https://web-platform-dx.github.io/web-features/) Widely Available on 2025-05-01 に含まれるブラウザーを対象にします。具体的には `['chrome107', 'edge107', 'firefox104', 'safari16']` です
1212

1313
もうひとつの特別な値は `'esnext'` で、これはネイディブの動的インポートをサポートしていることを前提としており、最小限のトランスパイルのみが実行されます。
1414

guide/build.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
## ブラウザーの互換性 {#browser-compatibility}
66

7-
デフォルトでは、プロダクションバンドルでは[ネイティブ ES モジュール](https://caniuse.com/es6-module)[ネイティブ ESM の動的インポート](https://caniuse.com/es6-module-dynamic-import)[`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta)[Null 合体演算子](https://caniuse.com/mdn-javascript_operators_nullish_coalescing)[BigInt](https://caniuse.com/bigint) といったモダンな JavaScript のサポートを前提としています。デフォルトのブラウザーサポート範囲は次のとおりです:
7+
デフォルトでは、プロダクションバンドルは [Baseline](https://web-platform-dx.github.io/web-features/) Widely Available ターゲットに含まれるモダンなブラウザーを前提としています。デフォルトのブラウザーサポート範囲は次のとおりです:
88

9-
<!-- Search for the `ESBUILD_MODULES_TARGET` constant for more information -->
9+
<!-- Search for the `ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET` constant for more information -->
1010

11-
- Chrome >=87
12-
- Firefox >=78
13-
- Safari >=14
14-
- Edge >=88
11+
- Chrome >=107
12+
- Edge >=107
13+
- Firefox >=104
14+
- Safari >=16
1515

1616
[`build.target` 設定オプション](/config/build-options.md#build-target)を介してカスタムターゲットを指定でき、最も低いターゲットは `es2015` です。より低いターゲットが設定された場合、Vite は[ネイティブ ESM の動的インポート](https://caniuse.com/es6-module-dynamic-import)[`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta) に依存するため、以下の最小ブラウザサポート範囲が必要です:
1717

guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Vite は完全な型サポートのある [Plugin API](./api-plugin) と [JavaSc
2222

2323
開発中、Vite は [`esnext` を変換ターゲットとして](https://esbuild.github.io/api/#target)設定します。これは、最新のブラウザーが使用され、最新の JavaScript および CSS 機能がすべてサポートされていることが前提となっているためです。これによりシンタックスの低下を防ぎ、Vite が元のソースコードにできるだけ近いモジュールを提供できるようになります。
2424

25-
本番ビルドの場合、Vite はデフォルトで [ネイティブ ES モジュール](https://caniuse.com/es6-module)[ネイティブ ESM 動的インポート](https://caniuse.com/es6-module-dynamic-import)[`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta)[Null 合体演算子](https://caniuse.com/mdn-javascript_operators_nullish_coalescing)[BigInt](https://caniuse.com/bigint) などのモダンな JavaScript をサポートするブラウザーをターゲットとします。レガシーブラウザーは、公式の [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) を通じてサポートできます。詳細については、[本番環境用のビルド](./build)セクションを参照してください。
25+
本番ビルドの場合、Vite はデフォルトで [Baseline](https://web-platform-dx.github.io/web-features/) Widely Available ブラウザーをターゲットとします。これらは少なくとも 2.5 年以上前にリリースされたブラウザーです。ターゲットは設定によって下げることができます。さらに、レガシーブラウザーは公式の [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) を通じてサポートできます。詳細については、[本番環境用のビルド](./build)セクションを参照してください。
2626

2727
## Vite をオンラインで試す {#trying-vite-online}
2828

0 commit comments

Comments
 (0)