Large, legacy codebases often suffer from tangled dependencies, lack of modular boundaries, and monolithic "barrel" files that bundle together many modules. This makes the codebase difficult to understand, modify, and scale. In this talk, we'll explore strategies for "untangling the barrel" and simplifying a complex codebase to prepare it for migration to a monorepo architecture.
We'll cover techniques for:
- Analyzing your code for cyclic dependencies
- Tools to help refactoring the code
- Establishing coding guidelines and automation to control codebase complexity going forward
This talk has been presented at Node Congress 2025, check out the latest edition of this JavaScript Conference.