Creating a local es6 compatible build?

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

Seems like one needs to at least do a

gulp typescript-all

for the es6 parts to build. Doing that however threw an error too, so I ran just

gulp

which takes quite some time, but builds the es6 parts I wanted to have

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.

Any Idea what I could be doing wrong?

@mauricedoepke -

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

@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.

Just run “npm run build” to get the fulllll build process :smiley: (including es6 build)

Yeah but that takes like 5 years. Is there a faster way?

gulp typescript-es6 will build the es6 libs only.
gulp [module]-es6 will build a specific module (loaders, inspector, core, etc’)

1 Like

image

3 Likes

If your build fails add this to the command: --max-old-space-size=8192

Is the Es6 build available in the preview dist folder on github ?


I can’t see where or what it is

I can’t see where or what it is

It goes here .temp\distES6

and then published to npm. we don’t publish it on github

Ok.
I thought there were a downloadable version for people wanting to not use npm, but just the final build.