Are you an LLM? You can read better optimized documentation at /glossary/barrel-module.md for this page in Markdown format
Barrel Module
A barrel module is a module that re-exports functionality from other modules, commonly used to create a cleaner public API for a package or directory:
js
// components/index.js (barrel module)
export { Button } from './Button';
export { Card } from './Card';
export { Modal } from './Modal';
export { Tabs } from './Tabs';
// ... dozens more componentsThis allows consumers to import from a single entry point:
js
import { Button, Card } from './components';However, barrel modules can cause performance issues because bundlers traditionally need to compile all re-exported modules, even if only a few are actually used. See Lazy Barrel Optimization for how Rolldown addresses this.