superpowers / superpowers-game

:video_game: Make 2D and 3D games in live collaboration with Superpowers
http://superpowers-html5.com/
Other
402 stars 93 forks source link

Pre-compile scripts on export #167

Closed MathieuLoutre closed 8 years ago

MathieuLoutre commented 8 years ago

I'm trying to reduce the payload/loading times for the game I'm working on. It looks like (from the console) that the TypeScript scripts are being compiled on the fly, even after export. Is there any way to pre-compile this and remove the compiler from the shipped code?

This may have the potential to make everything much lighter (there's over 2mo of JS shipped right now and it's unclear how heavy the plugins actually are but overall it could be well over 5mo). At the moment the loading time on mobile makes the whole thing almost unusable.

Ikalou commented 8 years ago

Hi,

There's already an issue on the topic : #158 ;)

EDIT: I've hacked something similar in one of my games that had a lot of scripts, and I can attest that it makes loading a lot faster on slower processors / mobile.

MathieuLoutre commented 8 years ago

Ah sorry! Completely missed that somehow. Will close and move to the other issue. Thanks!