So to it: tasked with researching babylonjs, got a decent demo working, built using typescript and so on, webpack, it outputs a bundle.js. So i figured i’d take bundle.js - which has all my classes compiled in from typescript, along with babylonjs i presume and use it in another project.
Not so easy. Managed to use many of the classes, but now i wanted to use modules and import some of the clases, and derive from them in my new webproject that consumes it. I’ve spent weeks on this, and in the end i’m just hacking through it, making it work with ugly code. I know i am missing something, require is for server side (this is for clientside), and my new webproject just wants to use the classes that i know are already in the bundle.js (which i’ve scripted in as a module). When i try to extend one of the classes it fails saying my class “is not defined”, though i can seem to instantiate the same class in code all the same (which makes no sense to me at all). I assumed the modules etc was to make life easier, but my experience has been anything but.
I’m probably approaching this all wrong, but weeks of google, and i’m still none the wiser? Anyone know how to go about this?