Angular CLI - ng run Command


Advertisements

Syntax

ng run project:target[:configuration]

ng run command runs an Architect target with an optional custom builder configuration defined in angular.json in your project. Here project is the name of the application as defined in angular.json. Options are optional parameters.

Arguments

Sr.No. Argument & Syntax Description
1 <target> Architect target to run.

Options

Sr.No. Option & Syntax Description
1 --configuration=configuration

A named builder configuration, defined in the "configurations" section of angular.json. The builder uses the named configuration to run the given target.

Aliases: -c.

2 --help=true|false|json|JSON

Shows a help message for this command in the console.

Default: false.

First move to an angular project updated using ng generate command and then run the command.

Example

\>Node\>Howcodex> ng run Howcodex:build
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.

chunk {polyfills} polyfills-es2015.js, polyfills-es2015.js.map (polyfills) 141 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 656 kB [initial] [rendered]
chunk {main} main-es2015.js, main-es2015.js.map (main) 12.9 kB [initial] [rendered]
chunk {main} main-es5.js, main-es5.js.map (main) 15.1 kB [initial] [rendered]
chunk {runtime} runtime-es2015.js, runtime-es2015.js.map (runtime) 6.16 kB [entry] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 6.16 kB [entry] [rendered]
chunk {styles} styles-es2015.js, styles-es2015.js.map (styles) 12.4 kB [initial] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 13.9 kB [initial] [rendered]
chunk {vendor} vendor-es2015.js, vendor-es2015.js.map (vendor) 2.66 MB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 3.11 MB [initial] [rendered]
Date: 2020-06-04T02:31:28.919Z - Hash: dd73885c28e550d01341 - Time: 13742ms

Here ng build command has built our project Howcodex successfully.

Advertisements