是否可以配置`pub build`以便它不会抑制提示和警告?

时间:2015-02-11 00:49:48

标签: dart dart-pub dart2js

当我运行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.

我尝试使用pub build --verbose --trace进行构建,并将--verbose添加到pubspec.yaml中的$ dart2js转换器commandLineOptions。

默认情况下,似乎dart2js 禁止提示和警告(因此--suppress-warnings--suppress-hints选项),但pub build“包装器“围绕dart2js更改了这些默认设置,并且没有真正的方法来启用详细程度。

1 个答案:

答案 0 :(得分:4)

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

另见:

Can you pass compiler flags to dart2js via Dart Editor

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