3

I'm working on Angular 8 and I wish to know if is there a command in order build the application removing the all the comments?

I'm using:

ng build prod 

but it doesn't remove the comments.

2
  • 1
    Have you checked that? Commented Sep 2, 2021 at 11:55
  • Yes, but I have not found a solution. Commented Sep 2, 2021 at 12:01

1 Answer 1

5

Check if angular.json has correct properties under production Refer to below sample code

"production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true }, 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.