Skip to content

Instantly share code, notes, and snippets.

@jcoglan
Created July 28, 2016 12:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcoglan/1848f79618af0aea602e8be3033e6125 to your computer and use it in GitHub Desktop.
Save jcoglan/1848f79618af0aea602e8be3033e6125 to your computer and use it in GitHub Desktop.
#!/bin/bash
function how-big-is {
local library="$1"
npm install "$library" uglifyjs webpack
echo "require('$library')" > index.js
./node_modules/.bin/webpack . build.js
./node_modules/.bin/uglifyjs build.js -cmo build-min.js 2> /dev/null
gzip -c build-min.js > build-min.js.gz
ls -lh build*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment