fateriddle Posted November 14, 2018 Share Posted November 14, 2018 Is there any plan to extract a light weight core of babylon.js for mobile? Currently, I downloaded the babylon.js file from mdn and size is around 2.1 M. That's way too big for me to run some simple game on smart phone. Can we extract a lighter version that only contains the core functionalities? And maybe then add everything else back onto the core using plugins / npm packages? I build a game to play on phone, and share it (qr code) internally in our company, the performance is not impressive to say the least, and we are considering switching to something lighter right now. But I actually like babylon.js so it feels like a shame. Just asking. Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 14, 2018 Share Posted November 14, 2018 You can build your own custom version. The only way I could do it I will describe below. Others may know alternatives You build from a local version of the BabylonJS/Babylon.js github repository. Read https://doc.babylonjs.com/how_to/how_to_start and rather than creating your own fork and cloning from that just clone directly to your local computer. Before doing the build part read https://doc.babylonjs.com/how_to/workloads to see which workloads to select and place in the `buildConfigurations` and set the `currentConfig` to this. The do the build part with gulp --max-old-space-size=8192 and you build of javascript files will be in the dist folder. NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2018 Share Posted November 14, 2018 v4.0 will let you treeshake the code in order to get only what you need. So far with current version you can rely on workloads (as @JohnK mentioned )to build your own version with only what you need Also 2.1M is without gzip so I highly encourage you to turn on gzip on your server and then the entire library is around 400K What do you mean by "the performance is not impressive "? Is that related to size of are you facing perf issues (https://doc.babylonjs.com/how_to/optimizing_your_scene) Quote Link to comment Share on other sites More sharing options...
fateriddle Posted December 26, 2018 Author Share Posted December 26, 2018 On 11/14/2018 at 5:20 PM, JohnK said: You can build your own custom version. The only way I could do it I will describe below. Others may know alternatives You build from a local version of the BabylonJS/Babylon.js github repository. Read https://doc.babylonjs.com/how_to/how_to_start and rather than creating your own fork and cloning from that just clone directly to your local computer. Before doing the build part read https://doc.babylonjs.com/how_to/workloads to see which workloads to select and place in the `buildConfigurations` and set the `currentConfig` to this. The do the build part with gulp --max-old-space-size=8192 and you build of javascript files will be in the dist folder. I got this error (see attach). Basically I clone the project, cd into Gulp folder, then run 'npm install' & 'gulp --max-old-space-size=8192' Everything seems fine, till the very end, I got this error. Haven't change anything, not trying to customize yet. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.