The End of Barrel Files? Angular Modularization with Sheriff
summary
Claims that barrel files (index.ts) break tree shaking and shows a working demo: replacing an index import causes the build to drop from 1.3 → 1.0 MB by keeping a large Quill editor in a deferred chunk. Uses Sheriff (CLI shown with npx sheriff list) to run a barrelless mode that treats folders as modules, enforces encapsulation via internal folders, preserves dependency rules, and coexists with NX libraries and secondary entry points.
AI-written summary · about
chapters (9)
- 0:00Introduction and speaker background
- 1:09Current use of barrel files
- 4:21Barrel files in modularity
- 7:10Problem with barrel files and tree shaking
- 9:18Removing barrel files impact
- 12:05Barrierless mode in Sheriff
- 14:55Encapsulation without barrel files
- 17:03Barrelless mode and real libraries
- 18:55Conclusion and Q&A
