phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37.22k stars 7.1k forks source link

[Suggestion] phaser3-examples - External Source Maps #3191

Closed jrasm91 closed 6 years ago

jrasm91 commented 6 years ago

This Issue is about

I noticed the examples at labs.phaser.io can often take a long time to load. Most of the time seems to be spent loading the phaser build

image

There are a lot of things that can be done to optimize the build, but one suggestion I have is to use external source maps, instead of embedded ones. This would immediately cut the build size in at least half.

Example: http://labs.phaser.io/build/113.js

photonstorm commented 6 years ago

I'm happy for them to remain inlined until we finish development. We build and dev locally, and run labs locally too, so the filesize isn't an issue for us, but the inlined source map is a massive boost to our productivity and keeps things easy when we publish new builds to go with the dev logs (as we just have to upload one build file)

When we hit final and move from labs to examples we'll make the sourcemap external, but for now, it really doesn't matter too much, as it's not for general consumption - we only really made the labs public for those interested in poking around during this dev period (admittedly, that's quite a lot of you though!). Once we're live, we'll likely close them off again.

jrasm91 commented 6 years ago

Awesome, sounds good. Thanks!