CachedBuildRunner enhances build_runner performance by caching generated code from unchanged Dart files, reducing redundant rebuilds. It minimizes build times in large projects by skipping regeneration of code that hasn’t changed, improving development efficiency. Ideal for projects using code generation extensively, such as with json_serializable or freezed, it integrates seamlessly into existing workflows without requiring configuration changes. The package is maintained on GitHub and supports all major Flutter platforms.
Use cases
- Large-scale code generation projects
- Faster incremental builds
- Reducing CI/CD pipeline time
- Projects using json_serializable or similar generators
- Improving developer workflow speed
Key features
- Caches generated code per file
- Skips re-generation for unchanged files
- Zero configuration required
- Seamless integration with build_runner
- Supports all Flutter platforms
Suitable for
- Developers using code generation frequently
- Teams aiming to reduce build times
- CI/CD environments with repeated builds
- Projects with extensive use of builders
Considerations
- May require cache cleanup in rare cases
- Not needed for small projects with minimal code generation
- Cache behavior depends on file modification detection
- Best used with stable build_runner versions
- Limited to Dart file change tracking