Vendor Chunk とは?
vendor chunk は、チームが書くコードとは分けて、サードパーティの依存関係のコードをまとめた bundle の出力です。ライブラリはアプリケーションのコードよりはるかに変化が少ないため、それらを分離することで browser は多くの deploy をまたいで vendor chunk を cache に保持できます。変更を出荷するときに再ダウンロードが必要なのは、より小さなアプリケーションの chunk だけです。
なぜ重要か
安定した vendor chunk は再訪ユーザーの cache ヒット率を高め、変わっていないライブラリの再取得を避けられます。代わりにすべてをまとめてしまうと、リリースのたびに cache 全体が無効化されます。
関連ガイド
What Is a Code Splitting Strategy?A code splitting strategy is the plan a build uses to break a bundle into smaller chunks loaded on demand, so…
What Is a Runtime Chunk?A runtime chunk is a small bundle holding the loader and module bookkeeping a bundler injects, kept separate…
What Is a Bundle Analyzer?A bundle analyzer is a tool that visualizes a build output, showing which modules and dependencies take up th…