pheedyoo / webgl-loader

Automatically exported from code.google.com/p/webgl-loader
0 stars 0 forks source link

Add flag to output minified JS instead of well-formatted JS #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A flag should be added (for example -m) that would cause the output to be 
minified:

No whitespace outside of strings.
No superfluous commas (commas before } and ]). These could be removed anyways.

I am working on a solution to this.

Original issue reported on code.google.com by j...@coderforlife.com on 14 Mar 2012 at 8:37

GoogleCodeExporter commented 9 years ago
Honestly, I don't think this is very important. Those extra bytes here and 
there basically don't count for very much when you have very large media 
downloads for textures and the meshes. And if you care about minification, then 
you could simply run the emitted code through an existing JS combiner/minifier.

It's not that I don't care about minifying JS, I just don't think that it is 
core to _this_ library. I've deprioritized it, but let me know if you have a 
strenuous objection.

Original comment by wonchun on 4 Apr 2012 at 2:39

GoogleCodeExporter commented 9 years ago
The more major issue is the extra commas (before } and ]). These cause problems 
with some JSON loaders. I have fixed this issue in my local code if you would 
like to see the changes (which also include the minification flag, but always 
does not have extra commas).

Original comment by j...@coderforlife.com on 4 Apr 2012 at 4:15

GoogleCodeExporter commented 9 years ago
OK, I'll get those extraneous commas out. I guess they are technically not 
legal JSON, but JSON.parse doesn't really mind.

Original comment by wonchun on 9 Apr 2012 at 10:50

GoogleCodeExporter commented 9 years ago
Quick update: so I plan on redoing all the JSON output to use the new JsonSink 
class. See r86.

Original comment by wonchun on 11 Apr 2012 at 6:43