Skip to content

Instantly share code, notes, and snippets.

@irae
Created March 9, 2016 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irae/2850090bfe672a857faf to your computer and use it in GitHub Desktop.
Save irae/2850090bfe672a857faf to your computer and use it in GitHub Desktop.
require('react') and Browsefiry versus CDN React sizes
# you might need to:
# npm install -g browserify
# npm install envify uglifyify react@0.14.7 react-dom@0.14.7
REACT=$(curl -L --silent https://fb.me/react-0.14.7.min.js)
REACTDOM=$(curl -L --silent https://fb.me/react-dom-0.14.7.min.js)
echo "React from CDN not gziped"
echo "$REACT $REACTDOM" | wc -c
echo "React from CDN gzip"
echo "$REACT $REACTDOM" | gzip -c | wc -c
REACTBUILD=$(NODE_ENV=production browserify -g envify -g uglifyify -r react -r react-dom)
echo "React manual build not gziped"
echo "$REACTBUILD" | wc -c
echo "React manual build gzip"
echo "$REACTBUILD" | gzip -c | wc -c
# Results as of March 9th 2016
# React from CDN not gziped
# 136289
# React from CDN gzip
# 39881
# React manual build not gziped
# 213464
# React manual build gzip
# 48278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment