Table of Contents

Web - Bundler

About

A bundler is a web build tool that

Example

// math.js
export function add(a, b) {
  return a + b;
}
// app.js
import { add } from './math.js';

console.log(add(2, 2)); // 4

Example of Bundle with the entry point being app.js (without any size reduction)

function add(a, b) {
  return a + b;
}

console.log(add(2, 2)); // 4

Features

They may allow:

but the goal remains the same:

Bundler vs Task Runner

The difference with a task runner is that they work on the file tree (dependency graph) and not on a list of files

task runner can still bundle but only on a collection of file, not based on a dependency tree

List