Skip to content
IT glossary
FrontendUpdated December 3, 2026

Bundler

Сборщик

A frontend build tool that follows an app’s imports and packages its code and assets into files a browser can load. It can also split the output so users only download certain features when they need them.

Also known as: бандлер, webpack, vite

What a bundler does

You might write a storefront as dozens of small modules and install a few packages for things like date formatting. You don't want to maintain a list of all those files in your HTML. A bundler starts from the app's entry points, works out what they depend on, and writes the files you'll deploy. Despite the name, it doesn't have to pack everything into one file.

From imports to deployable files

The bundler resolves imports such as ./cart.js and package names such as date-fns, then follows those modules' imports in turn. The result is a dependency graph: a map of what depends on what. The build pipeline can also transform JSX or TypeScript and handle assets such as CSS and images. Which transformations happen depends on the tool and its configuration.

The bundler groups code into output files called chunks. An entry chunk typically contains code needed to start the app; other chunks might contain shared dependencies or features that can wait. Production builds often include a content hash in each filename, so unchanged files can stay in the browser cache across deployments while changed files get new URLs.

Example: Keep a chart out of the initial load

button.addEventListener('click', async () => {
  const { showSalesChart } = await import('./sales-chart.js');
  showSalesChart();
});

A bundler can use this dynamic import as a split point. If the chart isn't needed by another part of the initial app and nothing fetches it ahead of time, its chunk can be downloaded on the first click. That saves work at startup for users who never open the chart, but it can make that first click slower. Check the build output and the browser's Network panel to see what actually happens.

Bundlers, dev servers, and optimizations

webpack is a bundler. Vite is a broader build tool: it provides a development server with hot module replacement and produces a bundled build for deployment. A fast update in development doesn't tell you how much JavaScript users will download in production. Small sites can also skip bundling entirely and serve native JavaScript modules directly.

Three optimizations are easy to mix up: tree shaking removes code the build can prove isn't needed, minification makes the remaining output more compact, and code splitting changes which files contain the code and when it can be loaded. Splitting a bundle doesn't necessarily reduce the total amount downloaded if the user eventually visits every feature.

What interviewers look for

If asked to shrink a large initial bundle, start by finding out what's in it. A feature that's rarely opened is a candidate for lazy loading; a package that ships unused code calls for a different fix. Explain how you'd compare initial transfer size and feature load time before and after the change.