How to disable Angular comments

Asked

Viewed 28 times

0

I’m starting to study Angular (current version) and I checked that after all the codes are compiled, the development information comments I put in the archives .ts are replicated to the files .js generated by Angular. These comments are available for reading in the sources of the generated page and displayed in the browser. I need the comments for documentation.

Is there any way to prevent comments from the files .ts are replicated to the files .js?

  • If you build for production you probably wouldn’t show up.

1 answer

1

Don’t worry about that, when you build for production(ng build --Prod), comments will be dropped, see what’s said on documentation: "Minification: removes excess whitespace, comments, and optional tokens."

  • Ah ok! I haven’t gotten there yet, but I appreciate the info. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.