cargo ux build

This is a Draft Version

Compiles an Angular Rust app into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.

cargo ux build <project> [options]
cargo ux b <project> [options]


The command can be used to build a project of type "application" or "library". When used to build a library, a different builder is invoked, configuration, and watch options are applied. All other options apply only to building applications.

The application builder uses the Ninja build tool, with default configuration options specified in the workspace configuration file (ux.yaml) or with a named alternative configuration. A "production" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the --configuration="production" or the --prod option.

The configuration options generally correspond to the command options. You can override individual configuration defaults by specifying the corresponding options on the command line. The command can accept option names given in either dash-case or camelCase. Note that in the configuration file, you must specify names in camelCase.

Some additional options can only be set through the configuration file, either by direct editing or with the ng config command. These include assets, styles, and scripts objects that provide runtime-global resources to include in the project. Resources in CSS, such as images and fonts, are automatically written and fingerprinted at the root of the output folder.

For further details, see Workspace Configuration.


ArgumentDescriptionValue Type
projectThe name of the project to build. Can be an application or a library.string


OptionDescriptionValue TypeDefault Value
--allowed-common-js-dependenciesA list of CommonJS packages that are allowed to be used without a build time warning.array
--aotBuild using Ahead of Time compilation.booleanfalse
--base-hrefBase url for the application being built.string
--build-optimizerEnables '@angular-devkit/build-optimizer' optimizations when using the 'aot' option.booleanfalse
--common-chunkGenerate a seperate bundle containing code used across multiple bundles.booleantrue
--configurationOne or more named builder configurations as a comma-separated list as specified in the "configurations" section of ux.yaml. The builder uses the named configurations to run the given target. For more information, see Setting this explicitly overrides the "--prod" flag. Aliases: -cstring
--cross-originDefine the crossorigin attribute setting of elements that provide CORS support.none|anonymous|use-credentialsnone
--delete-output-pathDelete the output path before building.booleantrue
--deploy-urlURL where files will be deployed.string
--extract-licensesExtract all licenses in a separate file.booleanfalse
--fork-type-checkerRun the type checker in a forked process.booleantrue
--helpShows a help message for this command in the console.true|false|jsonfalse
--i18n-missing-translationHow to handle missing translations for i18n.warning|error|ignorewarning
--indexConfigures the generation of the application's HTML index.string
--localizeTranslate the bundles in one or more locales.boolean
--mainThe full path for the main entry point to the app, relative to the current workspace.string
--named-chunksUse file name for lazy loaded chunks.booleantrue
--optimizationEnables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see
--output-hashingDefine the output filename cache-busting hashing mode.none|all|media|bundlesnone
--output-pathThe full path for the new output directory, relative to the current workspace. By default, writes output to a folder named dist/ in the current project.string
--pollEnable and define the file watching poll time period in milliseconds.number
--polyfillsThe full path for the polyfills file, relative to the current workspace.string
--preserve-symlinksDo not use the real path when resolving modules. If unset then will default to true if NodeJS option --preserve-symlinks is set.boolean
--prodShorthand for "--configuration=production". Set the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.boolean
--progressLog progress to the console while building.booleantrue
--resources-output-pathThe path where style resources will be placed, relative to outputPath.string
--service-workerGenerates a service worker config for production builds.booleanfalse
--show-circular-dependenciesShow circular dependency warnings on builds.booleantrue
--source-mapOutput source maps for scripts and styles. For more information, see
--stats-jsonGenerates a 'stats.json' file which can be analyzed later.booleanfalse
--subresource-integrityEnables the use of subresource integrity validation.booleanfalse
--vendor-chunkGenerate a seperate bundle containing only vendor libraries. This option should only used for development.booleantrue
--verboseAdds more details to output logging.booleanfalse
--watchRun build when files change.booleanfalse