Description of the problem
Three supports es6 modules, including a rollup, three.module.js. It does not provide a minified version, however.
This is a feature request to include three.module.min.js in the distribution.
The lack of three.module.min.js may be a result of the popular minifiers initially not being able to minify es6. This is no longer the case, see: butternut/squash https://github.com/Rich-Harris/butternut. Also uglify-es is a version of uglify-js that can minify es6+.
Three.js version
- Dev
- r97
- all versions
See the unpkg dashboard: https://unpkg.com/three@0.97.0/build/
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Actually, I think this is a fair thing to ask.
We have changed all the examples to use
three.module.js
. For a newbie, athree.module.min.js
would be the next step to reduce the bytes on their project.Not everyone wants to dive in the rabbit hole of bundlers.
That seems pretty nonstandard to me; better practice is for users to do minification after tree-shaking in their build. The subset of users who are going to copy/paste scripts without a build step AND use ES modules is diminishingly small, and I think we can avoid adding a new build artifact for them by recommending CDNs like JSDelivr and Unpkg instead. JSDelivr provides minification automatically:
… we could provide
.module.min.js
file ourselves, certainly, but most projects don’t, and it would complicate the build process to do so forexamples/jsm
, which users are presumably using at least some of.