コンテンツへスキップ
Latchkey

ダイナミックインポート境界とは?

ダイナミックインポート境界とは、コードが静的な import ではなく非同期の import 呼び出しを使う場所であり、対象モジュールを後で取得できることを示します。bundler はそのような呼び出しをそれぞれ継ぎ目として扱い、インポートされたコード用に別の chunk を出力します。モジュールは、実行が実際にその呼び出しに到達したときにのみダウンロードされます。

なぜ重要か

これらの境界は遅延ロードが起こる場所であり、めったに使われない画面のコードを必要になるまで先送りします。適切に配置すれば、ユーザーフローを壊さずに初期ペイロードを削減できます。

よくある質問

What is Dynamic import boundary?
A dynamic import boundary is the place where code uses an asynchronous import call instead of a static import, signaling that the target module can be fetched later. Bundlers treat each such call as a seam and emit a separate chunk for the imported code. The module then downloads only when execution actually reaches t…
Why does Dynamic import boundary matter in CI/CD?
These boundaries are where lazy loading happens, deferring code for rarely used screens until needed. Placing them well shrinks the initial payload without breaking the user flow.

関連ガイド