Closed trusktr closed 2 years ago
Not gonna do that, 'three'
is the recommended way of importing three.js, most of the unused classes get tree-shaken by bundlers. Also this would mean importing three.js twice for users who import it normally.
You can make three-projected-material
import from three/src/
with the alias
option of your favorite bundler.
When using a bundler true (although not all of them tree shake very well if at all), but some people also don't use bundlers just native ES modules.
I think three
should solve this by publishing only dist/three.module.js
, or src/
, instead of both.
https://github.com/marcofugaro/three-projected-material/blob/5e0ed6d0be30db43850384fb09acb7400a2d718f/src/ProjectedMaterial.js#L1
This line is a bad practice and imports the entire Three.js library, even if the consumer of
three-projected-material
does not need the entire set of Three.js classes. Instead, we should import only what is needed. f.e.: