简体   繁体   中英

Dart pub build mode not working

I'm trying to get Dart's pub build to run without minifying the generated JavaScript. According to this page I should be able to run it like so:

pub build --mode=debug

...which will force pub build to use the no-minify option.

However, when I run that, I get:

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

Running Pub 1.0.0+10.r30798 - any ideas?

Try running pub build --no-minify .

$ 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)

You can turn off js minification by adding a dart2js transformer in your pubspec.

For example

transformers:
- $dart2js:
   minify: false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM