overviews

Creating the Mini-fied Version


To create the minified version of Babylon.js you just have to use gulp

But you may want to work with all basic files. In this case, please download the code and use the following include (be aware to have the babylon folder at the root of your site. If you want to use your own shaders in this case, you just have to reference them with a "./" at beginning):

    <script src="tools/DevLoader/BabylonLoader.js"></script>

And add this command to your script:

    BABLONDEVTOOLS.Loader
        .load(function() {
            // Your code using Babylon.
        }
    );

This will take care of referencing all the required files and launch your code once ready.

If you need any script files to load after Babylon, you can require them:

    BABLONDEVTOOLS.Loader
        .require('index.js')
        .load();

You can also control the root of your Babylon Folder:

    BABLONDEVTOOLS.Loader
        .root('../../')
        .require('index.js')        
        .require('other.js')
        .load();

When working with all files, you can provide the following information to the engine:

  • BABYLON.Engine.CodeRepository: By default, this value points to "/src/"
  • BABYLON.Engine.ShadersRepository: By default, this value points to "/src/Shaders/"