Choose a version:
52% The original file has 1151589 bytes (1,124.6k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 598739 bytes (584.7k, 52%).

After GZIP compression these minified files vary in size:
unpkg
  221330 bytes (216.1k)
CDN
gzip -6 (default)
  151070 bytes (147.5k)
local copy
jsdelivr
  151018 bytes (147.5k)
CDN
gzip -9
  150578 bytes (147.0k)
local copy
libdeflate -12
  145229 bytes (141.8k)
local copy
7zip -mx=9 -tgzip
  145158 bytes (141.8k)
local copy
zultra
  145063 bytes (141.7k)
local copy
kzip -s0 -rn -b0
  144759 bytes (141.4k)
local copy
pigz -11 -n
  144648 bytes (141.3k)
local copy
Zopfli
  144612 bytes (141.2k)
local copy
Zopfli (defluff)
  144609 bytes (141.2k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/threejs/three-r142.min.js (or via HTTPS)

You will automatically get the smallest ThreeJS 142 file, ETag caching is available and
if your browser doesn't support GZIP decompression then the uncompressed version will be sent.

Currently best Zopfli settings

Save 6406 bytes by using my ThreeJS 142 Zopfli version instead of the best available CDN (4.43% smaller than jsdelivr, 144612 vs. 151018 bytes):
You can use my super-compressed files for whatever purpose you like as long as you respect the library's original license agreement.
There are no restrictions from my side - but please avoid hot-linking if you run a high-traffic website.

These command-line settings yielded the best compression ratio so far (Linux version of zopfli-krzymod):
zopfli --i1000000 --mb8 --mls8192 --bsr10 --lazy --ohh

(found August 2, 2022)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 10  --bsr10
lazy matching in LZ77 yes  --lazy
optimized Huffman headers yes  --ohh
initial random W for iterations 1  --rw1
initial random Z for iterations 2  --rz2

Even Smaller Files Thanks To Defluff

Zopfli's output can be further optimized by the defluff tool.
In this particular case, defluff saves 3 more bytes (144609 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://raw.githubusercontent.com/mrdoob/three.js/r142/build/three.min.js --location | md5sum
8b668fd701083f7e8df263fc56743cd2  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r142.min.zopfli.js.gz | md5sum
8b668fd701083f7e8df263fc56743cd2  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mrdoob/three.js/r142/build/three.min.js --location | sha1sum
5080854e83df71d16d8c6119f98dcc5710fdc518  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r142.min.zopfli.js.gz | sha1sum
5080854e83df71d16d8c6119f98dcc5710fdc518  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 221330 bytes 8b668fd701083f7e8df263fc56743cd2 (invalid)
jsdelivr 151018 bytes 8b668fd701083f7e8df263fc56743cd2 July 29, 2022 @ 14:38

Note: only the MD5 hashes are shown to keep things simple.

Other Versions

Available ThreeJS versions at minime.stephan-brumme.com:

142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50

The project site contains an overview how well these versions were compressed.
Other interesting projects are AngularJS, BackboneJS, Bootstrap, D3, Dojo, Ember, jQuery, Knockout, lodash, React, Socket.IO, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
144612 bytes -5 bytes zopfli --i1000000 --mls8192 --bsr10 --lazy --ohh August 2, 2022 @ 06:33
144617 bytes -10 bytes zopfli --i100000 --mls8192 --bsr10 --lazy --ohh July 29, 2022 @ 22:31
144627 bytes -18 bytes zopfli --i10000 --mls8192 --bsr10 --lazy --ohh July 29, 2022 @ 19:32
144645 bytes -21 bytes zopfli --i1000 --mls8192 --bsr10 --lazy --ohh July 29, 2022 @ 15:35
144666 bytes zopfli --i100 --mls8192 --bsr10 --lazy --ohh July 29, 2022 @ 15:21

If there are multiple parameter sets yielding the same compressed size, only the first one found is shown.

Most recent activity on August 2, 2022 @ 11:18.

Heatmaps

This Zopfli heatmap visualizes how compression changes when modifying the --bsr and --mls parameter.
Cell's contents is the best filesize achieved (in bytes, hover with mouse over cells to see number of iterations).

Good parameters are green, bad are red. The best and worst are bold as well.
The brightness of the blue background color indicates how many iterations were processed:
10,000, 100,000 or 1,000,000.
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
144860 144846 144854 144850 144881 144892 144897 144889 144891 144884 144883 144771 144880 144759 144862
144875 144809 144845 144851 144831 144849 144868 144794 144773 144780 144789 144660 144773 144802 144824
144838 144840 144821 144807 144821 144836 144843 144832 144789 144781 144793 144691 144694 144790 144819
144852 144825 144821 144837 144802 144841 144799 144818 144792 144780 144789 144706 144768 144783 144832
144841 144834 144789 144822 144802 144855 144793 144799 144819 144782 144707 144644 144780 144735 144747
144831 144837 144821 144788 144812 144829 144808 144775 144800 144784 144794 144692 144814 144811 144760
144841 144814 144806 144813 144815 144790 144797 144835 144795 144778 144676 144685 144612 144735 144803
144805 144825 144798 144837 144844 144842 144697 144745 144741 144786 144705 144813 144797 144807 144813
144837 144834 144821 144812 144817 144814 144786 144779 144801 144784 144788 144788 144821 144812 144813
144812 144813 144811 144808 144848 144836 144854 144771 144772 144786 144791 144687 144679 144785 144820
144840 144830 144821 144785 144833 144828 144797 144795 144780 144798 144798 144793 144627 144808 144823
144815 144831 144828 144794 144833 144801 144806 144796 144792 144798 144791 144792 144795 144731 144844
144814 144831 144811 144811 144806 144837 144776 144800 144778 144799 144797 144796 144783 144819 144817
144822 144817 144787 144808 144821 144833 144790 144804 144792 144785 144798 144801 144792 144789 144809
144832 144842 144819 144818 144806 144800 144794 144799 144797 144803 144783 144794 144813 144794 144813
144814 144819 144813 144816 144810 144826 144808 144796 144792 144784 144785 144786 144840 144736 144821
144817 144816 144810 144804 144806 144837 144801 144795 144795 144786 144799 144683 144793 144784 144810
144801 144793 144837 144799 144825 144811 144808 144800 144803 144793 144788 144795 144832 144842 144812
144804 144783 144791 144796 144806 144805 144780 144796 144792 144785 144791 144786 144772 144836 144809
144838 144837 144811 144801 144825 144823 144785 144776 144790 144785 144785 144686 144832 144831 144807
144822 144818 144818 144807 144805 144817 144784 144793 144795 144788 144787 144792 144643 144779 144828
144802 144804 144809 144797 144823 144826 144785 144778 144800 144786 144785 144694 144816 144807 144817
144812 144800 144821 144804 144810 144818 144784 144797 144795 144802 144786 144679 144641 144737 144828

Due to the Monte Carlo design of my search algorithm, not all parameters have reached the same number of iterations yet:
Iterations Min. Bytes Reduction Coverage
100 144666 bytes 100%
1,000 144645 bytes -21 bytes 100%
10,000 144627 bytes -18 bytes 100%
100,000 144617 bytes -10 bytes 0.58%
1,000,000 144612 bytes -5 bytes 0.29%
10,000,000

KZIP has far less options available for tuning/optimization. I only played around with the number of blocks (parameter -n):
Blocks Min. Bytes Compared To Best Zopfli Compared To Best KZIP
144759 bytes +147 bytes (+0.10%)
145464 bytes +852 bytes (+0.59%) +705 bytes
145438 bytes +826 bytes (+0.57%) +679 bytes
145272 bytes +660 bytes (+0.46%) +513 bytes
145099 bytes +487 bytes (+0.34%) +340 bytes
145103 bytes +491 bytes (+0.34%) +344 bytes
144851 bytes +239 bytes (+0.17%) +92 bytes
144832 bytes +220 bytes (+0.15%) +73 bytes
144834 bytes +222 bytes (+0.15%) +75 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
However, support for Brotli is constantly growing - for example, your browser actually supports it !
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 98495 bytes -46117 bytes (-31.89%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 117303 bytes -27309 bytes (-18.88%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 117457 bytes -27155 bytes (-18.78%)
Brotli (Wikipedia) brotli brotli -q 11 123299 bytes -21313 bytes (-14.74%)
LZMA2 (Wikipedia) xz xz -9 123544 bytes -21068 bytes (-14.57%)
Zstandard (Wikipedia) zstd zstd -19 129948 bytes -14664 bytes (-10.14%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 131424 bytes -13188 bytes (-9.12%)

Detailled Analysis

I wrote a DEFLATE decoder in Javascript. Click the button below to start a client-side analysis of the smallest gzipped files (may take a second):


Notes: pigz is a fast open source multi-threaded implementation of gzip written by one of the original authors of gzip.
However, when using compression level 11, pigz actually switches to the slower Zopfli algorithm and isn't multi-threaded anymore.
KrzyMOD's extensions to Zopfli offer the highest level of configuration and is therefore used for my brute-force search.
Ken Silverman wrote the closed-source KZIP compression program and Jonathon Fowler ported it to Linux.
Defluff was created by Joachim Henke; DeflOpt is a tool by Ben Jos Walbeehm.

website made by Stephan Brumme in 2015 and still improving in 2022.
all timestamps are displayed in central european time. see my changelog.
no flash, not even images or external css files - and everything squeezed into a single html file.
which was handsomely compressed before releasing it into the wild internet - obviously.

please visit my homepage and my blog, too.
email: minime (at) stephan-brumme.com

All trademarks are property of their respective owners. You know, the boring legal stuff.