Hello World WebGL build is 37 megs

It seems like at least some of this could be put in a shared JavaScript file that all Unity WebGL games could use. Then, that file could be hosted somewhere, the way the JQuery does, so that users aren’t constantly downloading massive amounts of duplicate code. My 6mb Web Player game is now a 220mb WebGL game. There is no way I can handle those bandwidth costs. Having ~37 megs of it already in the users cache before they get to my game would be a game changer (pun intended) for me and very convenient for the end user.

Also, shouldn’t Unity minify the JS in the build process?

1 Like

If your 6 MB Web Player game is now 220MB, you are not building and hosting it correctly. There are countless threads on this subject. Also, read: Unity - Manual: Build your WebGL application

Really? That’s your support quality? “There are countless threads on this subject”?

WebGL is completely unstable and unusable for production projects. There should be an official guide and proper support from Unity!

To be fair, those docs were helpful. However, it still feels like there is tons of redundant code being downloaded across all Unity WegGL games. It just seems like a significant amount of code could be shared across applications.

See this thread for some comments: http://forum.unity3d.com/threads/splitting-up-engine-javascript-from-game.321797/