Ok, thanks for the information, we’ll look at it again.
Hi!
Ok, I’d say we fixed it now.
I don’t know if it’s a TypeScript + Rollup issue only, but it seems that when
importing modules directly from the examples folder like:
import {SubdivisionModifier} from "three/examples/jsm/modifiers/SubdivisionModifier"
Rollup (at some point) keeps adding doubled three.js modules to the output-bundle (?!).
We fixed this by copying all needed modules from the three/examples/jsm
folder to a local project-folder + changing the import-statements inside the modules accordingly in our case to import {...} from "three"
& additionally adjusting the paths in the TypeScript declaration files. This fixed the bundle size AND the issue with the geometry.ids!
Maybe there is another, better way to fix this (?), but at the moment it’s okay for our needs.
Thank you very much once again!
FYI, I’ve created a small repo that shows a simple three.js
project setup with rollup and JavaScript.
As you can see in the build file, three.js
is only included once although JSM modules are used.
Hi, thank you, we’ll check the adaption to our project and see if it makes our “fix” redundant.