Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// utils.js — 3 exports export function add(a, b) { return a + b; } export function subtract(a, b) { return a - b; } export function multiply(a, b) { return a * b; } // app.js — only uses add import { add } from "./utils.js"; console.log(add(2, 3)); // After tree shaking, bundle contains only add() // subtract() and multiply() are eliminated
Result
Open