Command line Dart发布生成模式不工作

Command line Dart发布生成模式不工作,command-line,sdk,dart,Command Line,Sdk,Dart,我试图让Dart的发布构建运行,而不缩小生成的JavaScript。据我所知,我应该能够像这样运行它: pub build --mode=debug …这将强制pub build使用no minify选项 但是,当我运行该程序时,我得到: Could not find an option named "mode". Run "pub help" to see available options. 运行Pub 1.0.0+10.r30798-有什么想法吗?尝试运行Pub build--无需缩小

我试图让Dart的
发布构建运行,而不缩小生成的JavaScript。据我所知,我应该能够像这样运行它:

pub build --mode=debug
…这将强制
pub build
使用no minify选项

但是,当我运行该程序时,我得到:

Could not find an option named "mode".
Run "pub help" to see available options.

运行
Pub 1.0.0+10.r30798
-有什么想法吗?

尝试运行
Pub build--无需缩小

$ pub help build

Copy and compile all Dart entrypoints in the 'web' directory.

Usage: pub build [options]
-h, --help           Print usage information for this command.
    --[no-]minify    Minify generated JavaScript.
                     (defaults to on)

您可以通过在pubspec中添加一个来关闭js缩小

比如说

transformers:
- $dart2js:
   minify: false

页面上的内容是正确的,但仅适用于dev channel版本的用户。稳定版本的用户需要使用旧版本——目前没有缩小选项。谢谢@Claudio d'Angelis(+1)-我读的是那些旧文档吗?而且,
no minify
似乎实际上不起作用(尽管它确实运行)。当我查看
myapp.dart.js
文件时,它看起来仍然很模糊和缩小-Thinks?@TicketMonster如果要确保缩小工作正常,请尝试比较
--不缩小之前和之后的文件大小。如果它看起来模糊不清、缩小或一般不可读,那是因为它是生成的代码。