I am currently building a React application that utilizes THREE.js.
I want to import some code from THREE.js library, which is not part of the official distribution. Under the official repo for THREE.js, there are some modules under the examples folder, which the official doc for THREE.js makes use of to showcase examples.
How can I make use of these modules and use them in my own code?
In my app, I wanted to use the THREE.STLExporter module.
(https://github.com/mrdoob/three.js/blob/master/examples/js/exporters/STLExporter.js)
Because I already installed three as a dependency for my app, I first tried simply doing import * as THREE from 'three', which did not seem to do the trick.
Then I tried to access the examples folder directly and grab the module manually by doing `require('three/examples/js/exporters/STLExporter'), but this did not work either.
I have checked the source code for the official docs and noticed that the examples directly include the necessary modules in tags, but I don't want to do that because I am building a React app. I want to be able to include modules either via NPM or storing the code for the module within my app.
Please help out a noob here. Thank you!