What if I don't want to tree shake?

If I just want to jam, and for now not worry about manually including all the components I need can I wildcard import into my ES6 project the full build? How?

I tried ```
import * as BABYLON from ‘@babylonjs/core/Legacy/legacy’;

Which is what the ES6 example page showed, but it just throws compile errors as it cant find the Babylon components

Oh and :expressionless:

Hey, it should work.
Make sure you installed @babylonjs/core
In your js file import it like in the doc

import * as BABYLON from ‘@babylonjs/core/Legacy/legacy’;

After this in the code you have to use it something like

const engine = new BABYLON.Engine(canvas);
var scene = new BABYLON.Scene(engine);
(do not forget ‘BABYLON.’)

Here is a working example: BabylonJS ES6 - CodeSandbox
Cheers!

Just want to jam then How to get Babylon.js - Babylon.js Documentation is worth a read

1 Like