I believe your problem is that you need to start your import from THREE src / tree, which is not in build / dir, you will need to clone THREE to have a local src / tree against which your application is running.
In particular, you can use src / Three.js, which is a giant exporter of all THREE modules. Or just change the import to refer to src // module.js.
Then the cumulative package will have separate modules to run and, thus, skip unused code.
Edit: see https://github.com/mrdoob/three.js/issues/10328#issuecomment-290233801 for more
source share