Adding babylon extensions with es6 and typescript

I need to include a TextureCanvas from the babylon extensions.

From the readme file I have to do the following:
Import TextureCanvas from textureCanvas.ts/js , using modules from @babylonjs/core.

I got severeal issues. TextureCanvas is not part of @babylonjs/core.

The guide says using modules, does anyone know how to include TextureCanvas as a es6 module with Typescript declarations?

I would recommend to ask the creator of the module to publish it to npm. Until then, you will need to include this file in your project, and import from there : Extensions/TextureCanvas at master · BabylonJS/Extensions · GitHub

1 Like

The module was ES5, but now I’ve added an ES6 module as well:

The declarations file is also in there.

Does this work for you?

2 Likes

Sorry for the late answer!
It does indeed work, thank you :slight_smile:

2 Likes