Is there a way to include comments in generated JS files?


(Joshua Granick) #1

You can do untyped __js__ ("// insert my comment"); but this appends a semicolon at the end of your comment.

Is there a way to inject a line of code in the generated JavaScript, without a semicolon?

(Valentin Lemière) #2

I thought haxe.macro.Compiler.includeFile might do it ( but it also adds a semicolon.

Even the new js.Syntax.code
adds one, but maybe it could have an argument to disable it?

(Randy Maxwell) #3

@singmajesty, All

Has a fairly good way to do Comments in JavaScript, C++, C#, Java and Python (what I have tested).
Other Haxe output languages are checked for in sample code near the end but untested by me.

Thanks to the Haxe Forum members for the solution!