npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-minify-v2

v0.0.3

Published

Cordova hook that uglifies and minifies your app's Javascript, CSS and HTML files, as well as compresses your image files.

Readme

cordova-minify-v2

Cordova hook that uglifies and minifies your app's Javascript, CSS and HTML files, as well as compresses your image files. It is a modification of the work of Ross Martin's original cordova-uglify and Alastair Paragas' modified version, with the added default parsing of your top-level app folder www as well as minifying of HTML files.

This DOES NOT compress the assets in your www folder, but rather, on your respective platform's www folders, so your development environment isn't touched, and your apps stay fast and slim!

Install

Install this package inside of your app's root folder with this command.

npm install cordova-minify-v2 --save-dev

The --save-dev flag is important! If you decide to work on another environment, cordova-minify cannot run without the original package and its dependencies! After install, an after_prepare folder will be added to your hooks folder with the cordova-minify-v2.js script in it.

Usage

Once you have this hook installed it will compress your app's JavaScript and CSS when you run a cordova prepare <platform> or cordova build <platform> command. This hook does not change your assets that live in the root www folder; it will uglify the assets that get outputted to the platforms folder after a prepare or build.

By default the hook will uglify the JavaScript, CSS, HTML, and images in the <platform> www/js, www/css, www/img, www/javascript, www/style, www/html, and www/media folders of your project recursively (If they exist) as well as the top-level www folder (not recursively) to account for minifying the index.html and any other files that may reside there.

Take a look at this line in the hook to add more folders to be minified - optional.

You can configure the hook to uglify/minify only for a release build, see here. If you would like to have verbose logging, set debug to true here.

To disable parsing of the www folder, set processRoot to false here.

Options for HTML minification can be changed here and a list of all available options can be found here.

Javascript uglify options can be changed here and a list of all available options can be found here scattered throughout the page.

CSS minification options can be changed here and a list of all available options can be found here.

Requirements

Out of the box this hook requires Cordova 3.3.1-0.4.2 and above but it can work with versions 3.0.0 thru 3.3.0 if you manually indicate the path for the platforms directories on Android and iOS see here. This is because the CORDOVA_PLATFORMS environment variable was not added until version 3.3.1-0.4.2 (see this post by Dan Moore).

Dependencies:

Quirks:

  • On Linux and OSX: hooks folder needs to have permissions modified. Perform a chmod -R 755 /hooks to resolve this issue.

Original Work:

License

MIT