Angular CLI – Build Application in Production mode

If you are searching for the way to build an Angular application in production mode, this post is for you.

To do this, you simply run the following command in your application’s root directory:

  • angular/cli v6+
ng build --configuration=production

If you have installed angular/cli v6+, you will need to specify production value to --configuration option.
 

  • angular/cli v1.x
ng build --env=prod

If you have installed angular/cli v1.x, you will need to specify prod value to --env option.

Once the build process is finished, you will get compiled source code in the dist directory.

0 0 vote
Article Rating
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Радослав Младенов
Радослав Младенов
2 years ago

> ng build –env=prod –base-href=/

Unknown option: ‘–env’

2
0
Would love your thoughts, please comment.x
()
x