build_runner
2.17.1, released 5 weeks ago by tools.dart.dev
A build system for Dart code generation and modular compilation.
WASM-readyRock solid
What it does
A build system that executes code generators (builders) in Dart and Flutter projects. It supports running single builds or continuous watch modes to automatically update generated files when sources change.
AI-written summary of version 2.17.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using packages that require code generation like json_serializable or freezed
- You need to automate running builders in watch mode during development
Skip it when
- Your project does not use any code-generating libraries
- You want a zero-config setup without build tools
Strengths
- Integrates seamlessly with popular serialization and utility packages
- Supports incremental builds and continuous watch mode
Weaknesses
- Requires running commands via terminal or IDE to update generated files
- Can slow down build times on large projects
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 30
Add as a dev_dependency in pubspec.yaml and execute via dart run build_runner build or watch.
dart run build_runner watchWorks with
Packages commonly used together with build_runner: ones it builds on, ones built on it, and its own family.
- analyzerbuild_runner depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlbuild_runner depends on itA Dart library for parsing YAML documents into Dart data structures.
- cryptobuild_runner depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- pub_semverbuild_runner depends on itVersions and version constraints implementing pub's versioning policy.
- mimebuild_runner depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- globbuild_runner depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- package_configbuild_runner depends on itRead and write Dart package configuration files.
- poolbuild_runner depends on itManage a finite pool of resources to control concurrent operations.