I have been using requirejs for a long time when I had to develop big apps. Integrating three.js with this stack was no problem.
I am moving to webpack now, and everything is ok when importing three.js through npm. I use
import * as THREE from ‘three’;
And it works fine. But, what happens when I want to use an external script like OrbitControls or some postproduction. What would be the best way to import this scripts through webpack? Anyone has faced this issue before?
There is a massive thread about this issue on Github that presents a few possible solutions to this. It’s discussing converting the examples to modules in general but ends up being quite focussed on Webpack.