Provide minified version of three.module.js

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 Also uglify-es is a version of uglify-js that can minify es6+.

Three.js version
  • Dev
  • r97
  • all versions

See the unpkg dashboard:

  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

2 thoughts on “Provide minified version of three.module.js

  1. Actually, I think this is a fair thing to ask.

    We have changed all the examples to use three.module.js. For a newbie, a three.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.

  2. 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 for examples/jsm, which users are presumably using at least some of.

Comments are closed.