NPM plugin for minifying your CSS, JS, and images

I found using Yeoman for building my Ionic application in a certain way, too late because I already started more than a month ago by cloning the Git repository. I also found Grunt too cumbersome/time-consuming, and much like Yeoman, too much of an overkill and not really much of a nice fit for assets compression.

I made an NPM plugin that installs a nice Cordova hook so that after each app build cordova prepare <platform> or cordova run <platform>, your assets in the respective iOS and Android platforms get minified/uglified, and your images get some form of a compression. I would be glad if you can check it out here. The GitHub repository is here. You can install it simply by running npm install cordova-minify.

This is my first foray into making Node.js packages, so I’d be happy if you can give me some inputs!

3 Likes

Very nice, thanks for sharing this!

@aparagas Whoa this is pretty cool! A hook like this is on our todo list for the CLI so once I start to add something like this we can help contribute. Thanks!

@aparagas

Thank you for forking and adding functionality to my original cordova-uglify hook :blush:

Will you consider adding ng-annotate ? A GitHub user recently added a request for it on my repo and I integrated it. It will help out Ionic and Angular users :sunny:

@Ross No problem! It’ll just take some time because of Finals week (grrr). Thank you for your awesome plugin. Your implementation was so easy to add on to, that for me as a beginner Node.JS programmer back then, had an easy time configuring the script to have filesystem recursion and image compression.