code splitting

Dividing an app JavaScript into several files that load only when needed, instead of one big file up front.

In more detail

Route splitting loads each screen code when the user navigates to it; interaction splitting loads heavy features when the user asks for them. Bundlers create one chunk per split point.

Example

In React you split with dynamic import and React.lazy.

Related terms

Taught in

References