- Home /
WebGL size - 25mb js - am I doing anything wrong?
I am trying different technologies around, choosing the next platform I'd like to create my next simple game with.
The ability to export to WebGL is a paramount for me. I created a simple test game in Unity, exported it to WebGL and got... 25MB js file and 10MB data file! Looks like I am doing something wrong, perhaps, there is some sort of "dead code elimination" configuration check box I didn't check.. isn't there? I hope there is...
Have you checked Player Settings > WebGL > Other Settings > Optimization > Strip Engine Code? That should do what it can to make base size smaller, but the engine is there and it will always need quite a bit of code to work at all.
Answer by Schubkraft · Feb 20, 2017 at 10:42 AM
Make sure to enable "strip engine code", development builds are bigger than release builds.
You can also check the build report (preview feature) by going to https://files.unity3d.com/build-report/ after making a build and then get a better insight what contributes to your data file and JS code size.
An empty scene build should be about 2.5MB
Your answer
Follow this Question
Related Questions
Unity5 Web GL Build Size 1 Answer
WebGL build size does not change after reducing textures size 0 Answers
Embedded HTML for Unity WebGL build 0 Answers
reducing WebGL startup time 1 Answer