Open DanielRamosAcosta opened 4 years ago
Related to #15
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.
Can you try to phrase it as a task? Support ES Modules in release
Can you make a screenshot or a screencast? With the usage of new build tools like vite, it throws the following error:
Is all information accessible for us? I think so. The way to solve this would be building an ESM version and release it in the same package. You could check how is it done with rxjs
I can PR if you want! 😄