john-science / john-science.github.io

A Blog of Minor Obsessions
http://john-science.github.io/
Apache License 2.0
3 stars 4 forks source link

Shrink JavaScript #29

Closed john-science closed 7 years ago

john-science commented 7 years ago

Before sending my JavaScript code to a user, it would be better if it were uglified and compressed. I could do this at every commit. But, ideally, I would only need to keep the beautified JavaScript in my repo, and the GitHub Pages build process would uglify and compress the files, so that they are as small as possible when the user gets them.

john-science commented 7 years ago

Perhaps GitHub Pages already gzip's content? Check that:

http://webmasters.stackexchange.com/questions/56561/is-gzip-compression-available-for-github-pages

It would still be nice to minify/uglify the JavaScript before sending it:

http://stackoverflow.com/questions/28932/best-javascript-compressor

https://github.com/mishoo/UglifyJS

john-science commented 7 years ago

This guy's GitHub blog uses Grunt as a tech stack to do all of this: http://davidensinger.com/2015/01/performant-websites-with-jekyll-grunt-github-pages-and-cloudflare/

john-science commented 7 years ago

There will not be a GitHub build hook for this. It would have to be a build hook on my side.

john-science commented 7 years ago

Yeah, this isn't happening automatically as part of the GH Pages build. So, oh well.