My understanding is that tree-shaking three.js can be done now, but is not easy yet. See Tree Shaking Three.js for details.