jnsmalm / pixi3d

The 3D renderer for PixiJS. Seamless integration with 2D applications.
https://pixi3d.org
MIT License
759 stars 44 forks source link

Please change comments in code as they enter the copyright realm! #92

Closed Friksel closed 2 years ago

Friksel commented 2 years ago

We're building a project with Webpack we use Terser (newer uglyjs lib) to compress all javascript. Terser extracts all copyright info and put it nicely in a copyright file so the copyright info doesn't get lost and is for willingly to read.

This works fine for all libs we use as they all have their copyright information behind comments starting with /*!.

However, pixi3d is using the same prefix for a whole bunch of comments in the javascript, resulting all kinds of junk being included in the copyright file now, so users see this in the copyright file, coming from pixi3d, which is obviouly not copyright information: image

You might understand we don't like this and want to ask you if you could replace these 'copyright'-prefixes with normal comment prefixes, like / or /*. On the other hand you could also add your copyright information in there WITH the given 'copyright' (/*! ) prefix so it gets included in there. For you this would probably mean 5 minutes of work, but for us it's basically impossible to strip it out as it's all being done automatically by terser on each webpack build.

Could you please change these comment prefixes?

Thanks in advance!

jnsmalm commented 2 years ago

Those comments are produced by Webpack when building Pixi3D and is not something I have put there by hand. I can see what can be done.

Friksel commented 2 years ago

@jnsmalm Thanks a lot. Very appreciated! I'm using Webpack for all projects too, but never seen this output (I'm not using Typescript tho, but do transpile Javascript through Babel). Could be because I'm using Terser tho, but looks like if you're not adding these yourself or use libs that have them, it's generated by the Typescript to Javascript transpiler you use?

Doing a quick search I found this removeComments-setting for tsconfig.json. Not sure if these are removing all comments and prevent the transpiler from adding them, but could be worth the try. Perhaps that could help? https://www.typescriptlang.org/tsconfig#removeComments

jnsmalm commented 2 years ago

Found a Webpack setting which could remove these comments, will be fixed in next release.

Friksel commented 2 years ago

@jnsmalm Faster than the speed of light! Thanks a lot for this quick action and have a nice weekend!

Friksel commented 2 years ago

@jnsmalm Just compiled with the new pixi3d version and can confirm all comments are gone. Thanks!