If I use the following code in pubspec.yaml
file, then the build_runner
generates code but if I put it in the build.yaml
file, then the code is not generated for fromJson
and toJson
.
targets:
$default:
builders:
json_serializable:
enabled: true
generate_for:
include:
- lib/foo.dart
I also want to know, whether I include (or not include) any files above, the code takes same amount of time to generate. So, how can I then generate the code for a specific file/directory, like first generate for foo.dart
and later on I want to generate code for bar.dart
keeping foo.dart
and foo.g.dart
intact.