How to include ThreeJS with TrackballControls.js into widget inorder to create some webgl.

Hello i try to create a WebGL widget using Threejs & TrackballControls.js external libs. i am unable to include TrackballControls.js because it is not an amd module and this file is dependent on Threejs instance. if anyone has any idea we can include both the libs and create a basic example please share some suggestions.  
1 answers

Have a look at the following two repo's:

The generator uses widget-base as a starting point. If you look into the src folder, you will see that the widget is built using an ES6 setup. Furthermore, you'll be able to include any browser-compatible npm module in the widget. Here's for example one where I use a json component from NPM: