Import MeshWriter extension in typescript project

Yeah, that’s an interesting issue…

The only workaround I see is importing the BABYLON namespace and setting window.BABYLON. Something along the lines of this:

import * as BABYLON from '@babylonjs/core';
(window as any).BABYLON = BABYLON;

The MesWriter has no UMD / modules support (at least not according to the code) so you will need to define babylon globally.

You can try submitting an issue here - GitHub - briantbutton/meshwriter: Babylon Mesh Writer , the developer might have a better solution

1 Like