Build Options
Reference for all available configuration options in the build.yaml file.
Configuration Structure
Section titled “Configuration Structure”targets: $default: builders: design_builder|design_builder: enabled: true options: # Options go hereOptions Reference
Section titled “Options Reference”spec_path
Section titled “spec_path”Type: string
Default: lib/schema/theme-spec.schema.json
Path to the JSON schema file that validates your token files.
options: spec_path: "assets/schema.json"input_glob
Section titled “input_glob”Type: string
Default: lib/**.tokens.json
Glob pattern to locate your token JSON files.
options: input_glob: "lib/**/*.tokens.json"output_path
Section titled “output_path”Type: string
Default: design_tokens
Directory where generated files will be placed, relative to the lib folder.
options: output_path: "generated/themes"output_file_name
Section titled “output_file_name”Type: string
Default: app_theme
Name of the generated Dart file (without the .dart extension).
options: output_file_name: "my_app_theme"class_name
Section titled “class_name”Type: string
Default: AppTheme
Name of the main generated class.
options: class_name: "MyAppTheme"Complete Example
Section titled “Complete Example”targets: $default: builders: design_builder|design_builder: enabled: true options: spec_path: "lib/schema/theme-spec.schema.json" input_glob: "lib/**.tokens.json" output_path: "design_tokens" output_file_name: "app_theme" class_name: "AppTheme"Environment-Specific Configurations
Section titled “Environment-Specific Configurations”Create different configurations for different environments:
targets: development: builders: design_builder|design_builder: enabled: true options: input_glob: "lib/tokens/dev/*.json" production: builders: design_builder|design_builder: enabled: true options: input_glob: "lib/tokens/prod/*.json"Run with a specific target:
dart run build_runner build --config=build.yaml -t production