Skip to content

Files

Latest commit

 

History

History
23 lines (17 loc) · 594 Bytes

no-barrel-file.md

File metadata and controls

23 lines (17 loc) · 594 Bytes

Pattern: Large barrel import/export

Issue: -

Description

Barrel files using export * or import * that exceed the module threshold (default 100) can significantly impact build performance and bundle size. Use explicit exports instead.

Examples

Example of incorrect code:

// index.ts with >100 re-exported modules
export * from './components';
import * as Components from './components';

Example of correct code:

// Explicit exports
export { Button, Card, Modal } from './components';
import { Button, Card, Modal } from './components';