Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Typescript from emitting @class comments

In my project, the Typescript compiler compiles my classes like so:

class Example
{
    ...
}

into:

var Example = /** @class */ (function () {
  function Example() {
  }
  return Example;
}());

How can I configure Typescript (currently using VS2015) so that it doesn't emit that @class comment?

like image 457
Joshua Frank Avatar asked Sep 14 '26 22:09

Joshua Frank


1 Answers

There is no way to remove just the /** @class */ comment. I checked the source code and it does not seem to be controlled by any special compiler flag. The only way to remove this comment is to remove all comments, using the --removeComments compiler option.

like image 87
Titian Cernicova-Dragomir Avatar answered Sep 17 '26 14:09

Titian Cernicova-Dragomir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!