ryanwebjackson
ryanwebjackson

Reputation: 1048

How can comments be removed from HTML files during an angular(js) build process?

This should be straightforward - Is there a way to remove comments in HTML/view output during an angular build or render processes? The goal is simple - I don't want users to see them. I know this can be done with something like Grunt or Gulp, but want the comments to be visible during development (and currently have Grunt for a build tool). I've heard this can be done using the Angular CLI, which I know is for use in Angular >=2.0 projects, but am not sure if it could be using in a 1.x/JS project.

Upvotes: 2

Views: 2009

Answers (1)

Dejan Stojanovic
Dejan Stojanovic

Reputation: 46

In Angular 2+:

ng build --prod

creates the dist/ folder in the root. It contains via webpack stripped down code without any comments, at least with the standard configuration.

Upvotes: 3

Related Questions