Skip to content
pubscout

lean_builder

1.2.2, released 3 months ago by codeness.ly

Lean Builder: a fast, efficient Dart build system for code generation

$ flutter pub add lean_builder
Source repository

What it does

Lean Builder provides a streamlined alternative to the Dart build system, enabling fast incremental builds and hot reload for generators. It offers declarative builder configuration via annotations and supports shared part, library, and standard builders.

AI-written summary of version 1.2.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to create code generators with fast incremental builds
  • You want a simpler, more performant alternative to build_runner
  • You need watch mode with hot reload for generator development

Skip it when

  • You require the full feature set of the official Dart build system
  • Your project is already heavily dependent on build_runner and source_gen

Strengths

  • Fast incremental builds
  • Parallel processing for maximum efficiency
  • Hot reload support in watch mode
  • Simple declarative configuration using annotations

Weaknesses

  • Not fully tested, active development
  • Limited ecosystem compared to build_runner
  • May lack some advanced features of the official build system

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
16

Add lean_builder as a dev_dependency in pubspec.yaml. Run commands like `dart run lean_builder build` or `dart run lean_builder watch`. No additional build_runner setup required.

```dart
@LeanGenerator({'.lib.dart'})
class MyGenerator extends GeneratorForAnnotatedClass<MyAnnotation> {
  @override
  Future<String> generateForClass(buildStep, element, annotation) async {
    return '// Generated code for ${element.name}';
  }
}
```

Alternatives

Packages that do the same job and could replace lean_builder.

Works with

Packages commonly used together with lean_builder: ones it builds on, ones built on it, and its own family.