-1

I have developed an Angular application and released on Sandbox machine. Now I want to release it on Enterprise virtual machine.

I want to generate production build for Enterprise VM. Right now my dist size is 174 MB, I am assuming it reduce in prod build, am I correct? I am thinking I need to run first ng build --prod and then ng serve --prod and take the dist out.

In my project there is environment folder with two file environment.ts and environment.prod.ts, what should I do with these two.

If I try ng build --prod getting errors here 'router-outlet' is not a known element while executing ng build --prod

How should I generate production build?

R15
  • 13,982
  • 14
  • 97
  • 173

1 Answers1

0

I have successfully generated my production build. For production we do not need to use ng serve --prod.

First we need to execute ng build --prod and then ng serve.

ng build --prod is doing minification of our dist folder and ng serve just starting our project/server.

I have facing few issue related memory heap out of memory for that I needed run below command run these commands in terminal.

R15
  • 13,982
  • 14
  • 97
  • 173