1

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.

Alex Pappas
  • 2,377
  • 3
  • 24
  • 48
yihijes925
  • 39
  • 7

1 Answers1

3

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
},