Build is one of the commands of the pub tool. Learn more about pub.
$ pub build [--mode=<mode>] [<directories>] [--output=<directory>] $ pub build [--mode=<mode>] [--all] [--output=<directory>]
pub build when you’re ready to deploy your web app. When you run
pub build, it generates the assets
for the current package and all of its dependencies, putting them into
new directory named
pub build, just run it in your package’s root directory. For example:
$ cd ~/dart/helloworld $ pub build Building helloworld...... Built 5 files!
If the build directory already exists,
pub build deletes it and then creates
To generate assets,
pub build uses
transformers. Any source assets
that aren’t transformed are copied, as is, into the build directory
or one of its subdirectories. Pub also automatically compiles your
See Configuring the Built-in dart2js Transformer for information on how to configure the dart2js options in your pubspec.
See Pub Assets and Transformers for information on:
pubspec.yamlto specify which transformers run, and in what order.
pub serve. With
pub serve, you can run a
development server that continuously generates and serves assets.
For options that apply to all pub commands, see Global options.
lib(which is always processed). The default value is
web. Directories you might typically specify include the following:
pub build test benchmark example/foo barIn the preceding example, the
bardirectories are processed, as is the
webdirectory is not built because it isn't specified.