Build tools: webpack and Vite
Bundlers, webpack and Vite, code splitting and what a build actually does.
15 lessons 28 practice questions about 1 hours of reading
Chapter 1, beginner
Foundations
What it is and how it works, the questions every round starts with.
- 01How do environment variables work in Vite and webpack?
Lesson, 5 min read, then 3 questions to practise
- 02What is a JavaScript bundler and why do you need one?
Lesson, 5 min read, then 5 questions to practise
- Build a mini module bundler: resolve imports, build the graph, handle cycles and emit one runnable bundle
- Simulate tree shaking: follow imports and re-exports, keep side-effectful modules and report what is removed
- Resolve module specifiers with an import map: imports, trailing-slash prefixes and the most specific scopes
- Investigate a bundle that grew from 300 KB to 900 KB and enforce budgets in CI
- Work out when scripts run: classic, async, defer, module and inline scripts against the parser
- 03Why does a deployed single-page app return 404 on refresh, and how do you fix it?
Lesson, 5 min read, then 5 questions to practise
- Implement a basic client-side router using the History API
- Choose Cache-Control headers for hashed assets, HTML and API responses
- Lazy-load route components with React.lazy, preload on hover and retry failed chunks
- Build a route matcher with params, optional segments and wildcards, ranked by specificity
- Restore scroll positions in a single-page app: save per history entry, restore on Back, reset on new navigation
Chapter 2, intermediate
In depth
How it behaves under the hood, and the follow-ups that come next.
- 05How do you configure path aliases and the base path in Vite?
Lesson, 6 min read, then 1 question to practise
- 06Webpack loaders vs plugins: what is the difference?
Lesson, 5 min read, then 1 question to practise
- 07Webpack vs Vite: what is the difference?
Lesson, 4 min read
- 08What are source maps and should you ship them to production?
Lesson, 5 min read, then 3 questions to practise
- 10What is Babel and do you still need it?
Lesson, 5 min read, then 3 questions to practise
- 11What is tree shaking?
Lesson, 4 min read
- 12What is Vite and why is it so fast?
Lesson, 5 min read, then 1 question to practise
- 13What is webpack and how does it work?
Lesson, 6 min read
Chapter 3, advanced
Senior level
Trade-offs, edge cases and the questions senior rounds end on.
- 15How does hot module replacement (HMR) work?
Lesson, 6 min read, then 1 question to practise