3

I'm trying to not get messages like this when I run pub build:

WARN: [Dart2JS on mylib|web/mylib.dart]:  
    | 1 warning(s) and 2 hint(s) suppressed in package:otherlib.  
WARN: [Dart2JS on pinged|web/mylib.dart]:   
    | 2 warning(s) suppressed in package:mylib.  
WARN: [Warning from Dart2JS on mylib|web/mylib.dart]:  
    | 1 hint(s) suppressed in package:mypackage.  
WARN: [Warning from Dart2JS on pinged|web/mylib.dart]:  
    | 1 hint(s) suppressed in package:otherpackage.

I've tried building with pub build --verbose --trace and adding --verbose to my $dart2js transformer commandLineOptions in pubspec.yaml.

It seems that, by default, dart2js does not suppress hints and warnings (hence the --suppress-warnings and --suppress-hints options), but the pub build "wrapper" around dart2js changes these defaults and gives you no real way to enable verbosity.

Lucas Meadows
  • 2,939
  • 2
  • 14
  • 4

1 Answers1

4
transformers:
- polymer:
    entry_points: web/index.html
- $dart2js:
    commandLineOptions: [--show-package-warnings] 

see also:

Can you pass compiler flags to dart2js via Dart Editor

https://www.dartlang.org/tools/pub/dart2js-transformer.html

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Upvoted -- thank you. This gives me verbose warnings, though it seems to completely suppress hints now, and I don't even get counts for those (on the 1.8.3 SDK anyway). – Lucas Meadows Feb 12 '15 at 17:09
  • 1
    Since you can pass command line options via `$dart2js`, can you also pass `--surpress-warnings` ? – Seth Ladd Feb 13 '15 at 04:07