A bundler is a web build tool that
// 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
They may allow:
but the goal remains the same:
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