yihijes925
yihijes925

Reputation: 59

How to remove code comments on `ng build prod`?

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.

Upvotes: 3

Views: 2520

Answers (1)

Devendra Kumbhkar
Devendra Kumbhkar

Reputation: 285

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

Upvotes: 5

Related Questions