Skip to content

Commit

Permalink
chore: warning about ssr cjs format removal (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
MH4GF authored Jul 18, 2023
1 parent 48da092 commit 144b966
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/ssr-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SSR サーバのビルドターゲット。
## ssr.format

- **実験的機能**
- **非推奨** Vite 5 では ESM 出力のみがサポートされます
- **型:** `'esm' | 'cjs'`
- **デフォルト:** `esm`

Expand Down
4 changes: 4 additions & 0 deletions guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,7 @@ SSR ビルドのデフォルトターゲットは Node 環境ですが、Web Wor
## SSR 形式
デフォルトでは、Vite は SSR バンドルを ESM で生成します。`ssr.format` 設定の実験的なサポートがありますが、推奨されていません。SSR の開発に関する今後の取り組みは ESM を基本とし、後方互換性のために CommonJS は引き続き利用可能です。もし、あなたのプロジェクトで SSR に ESM を利用できない場合は、 `legacy.buildSsrCjsExternalHeuristics: true` を設定することで、[Vite v2 と同じ外部化戦略](https://v2.vitejs.dev/guide/ssr.html#ssr-externals)を利用して CJS バンドルを生成できます。
:::warning 警告
実験的な `legacy.buildSsrCjsExternalHeuristics``ssr.format: 'cjs'` は Vite 5 で削除される予定です。[このディスカッション](https://github.com/vitejs/vite/discussions/13816)で詳細情報を見つけ、フィードバックしてください。
:::

0 comments on commit 144b966

Please sign in to comment.