React Code-Splitting: Two Explanations Quiz
Two explanations of code-splitting (bundler-level vs `React.lazy` + `Suspense`) plus companions on preloading routes and on splitting non-component utilities.
Question Bank
Hard
JavaScript
quiz
react
performance-optimization
design-patterns
896 views
7
Explain bundler-level code-splitting: what does a bundler like webpack or Vite do when it sees a dynamic import(), and what files end up in the network waterfall?
Examples
Example 1:
Input: a route handler calls import('./Dashboard') inside an event handler.
Output: the bundler emits Dashboard's module graph as a separate chunk; the main bundle ships without it.
Explanation: on the click that triggers the import, the browser fetches the Dashboard chunk; otherwise the user never pays for it.3 more questions, with full solutions and explanations, are available for premium members.
Upgrade to Premium