pnext / three-loader

Point cloud loader for ThreeJS, based on the core parts of Potree
Other
201 stars 88 forks source link

Support ES Modules in release #67

Open DanielRamosAcosta opened 4 years ago

DanielRamosAcosta commented 4 years ago

I can PR if you want! 😄

DanielRamosAcosta commented 4 years ago

Related to #15

midnight-dev commented 4 years ago

Since the majority of the platform is TypeScript, it wouldn't be compatible with ES modules out of the box - not unless I've missed some major developments in TS. However, I'm sure you could configure the compiler / webpack to give you small ES modules. I'd like to see a PR for that if you already have something that works, @DanielRamosAcosta :+1:

Edit: Ah, after giving this another look, I believe you mean compiling to a module form instead of many pure JS modules that don't require compiling. In which case, my branch probably isn't want you were looking for. Scratch that.

If your objective is to have Potree features in ES modules for tree-shaking or rapid dev work that wouldn't require compilation, I might have something for you. I transformed one of my local Potree branches into pure modules that load directly in Firefox and Chrome. There are several circular dependency issues I would've liked to iron out, but I may not have time. If this would be of any use to you (as it's pure Potree, not pnext), then I can push that special branch to my fork.