How to set dart2js --minify parameter from command line when doing `pub build`?

For my release process, I need several different “modes”. However, if I use the parameter --modefor pub buildand set it to any value other than release, it forces unminified javascript.

I know that I can configure the dart2js transformer in my own pubspec.yaml, but if I installed it minify: trueunder the heading $dart2jsin mine pubspec.yaml, I force them to be minified, and then cannot create un-shortened debug assemblies.

What I'm really looking for is a way to configure arbitrary dart2js parameters (minified, checked, etc.) in pub buildvia the CLI (so I don't need to hardcode in pubspec.yaml), or, otherwise, to specify additional arbitrary flags from CLI pub buildso I can reserve --modefor debugand release. The transformer constructor asPlugin()accepts the object BarbackSettings, but I don’t see how to see arbitrary parameters through the command line .

+4
source share
1 answer

(, ), , . http://dartbug.com.

, , - script, pubspec.yaml pub build. https://pub.dartlang.org/packages/yaml.

+1

All Articles