This forum is read only and just serves as an archive. If you have any questions, please post them on

10 years ago by Joncom

The following works just fine.

    // Load certain mobule if on mobile.
    ( ? '' : '' ),

However, when baking the game I get the error:
ERROR: Couldn't load lib/(!ig/ua/mobile?game/mobile........etc.

Is there a way to prevent the requires process from loading something based on a variable like and be able to still bake it?

Editted for clarity.

10 years ago by fulvio

In your main.js, outside of the game.main module:

if ( {
} else {


This will define an empty dummy mobile module when running on mobile and the default impact module if not.

It's quite the hack, but it seems to work fine. Baking might chuck a hissy-fit though.

10 years ago by Joncom

Works wonderfully, and bakes no problem!

Thank you fulvio.
Page 1 of 1
« first « previous next › last »