I’m looking for a way to build the es6 version of babylon. I tried it with the publish tool (node ./index.js in the tools/publisher folder), which seemingly creates the umd version successfully, but fails at the es6 version with:
Error: ENOENT: no such file or directory, lstat ‘C:\Users\Mauri\Desktop\projekte\sscjs\Babylon.js.temp\distES6\core’
Any idea how to solve that? (I already ran gulp typescript-libraries) before the publisher
Ok that doesn’t work, the build seems to be broken somehow.
Somehow variable scope works strange. For example I can’t load the gltf plugin through the standard side effect method. The Gltf-loader attaches itself to the SceneLoader by calling it’s registerPlugin() method. This method adds the loader to the static class variable _registeredPlugins. This static variable should normally be the same everywhere. But somehow even though the side effect definitely gets executed, the _registeredPlugins variable does still not contain the gltf loader in the scope of my main file from which I did the import.
Additionally the PhysicsEngine monkey patches the AbstractMesh class which is also broken in my build.
I don’t know what editor you’re using as a dev tool to write code and for compliance. I personally like Atom - it’s open source and has practically every compliance and development environment you’d ever want available. Using Atom, simply highlight your code and with one keyboard shortcut, you have ES6 compliance without having to figure out anything further.
The only issue is that it’s easy to become lazy; so I recommend writing everything in ES6 moving forward. In my opinion it’s been supported long enough now, that every browser I currently use is ES6 compliant. I’ll be curious to hear if there are any other opinions on the forum. It’s not spoken of much and needs to be covered; as I know there’s allot of new developers who aren’t familiar with ES6 and should be by now.
@Galen
I think I was not clear enough. My question is how to build the babylonjs library from the github repository as es6 compatible version. The master contains fixes that are not yet published on npm. Babylon can be build as umd and since recently as es6 compatible version. But the es6 version has the problems I explained above. The npm version works fine, so I must be doing something wrong during the build
My own codebase is written in typescript.