Gianluca Ghettini Gianluca Ghettini - 3 years ago 199
Android Question

Cordova minifier doesn't minify the browser platform

I downloaded the

cordova-minify
plugin which minifies my Cordova app javascript code. I tried running the command:


cordova build browser


I get


cordova-minify STARTING - minifying your js, css, html, and images.
Sit back and relax!

Hook currently supports only Android and iOS


Why the minifier can't minify the browser version? What it means "Hook currently supports only Android and iOS"? What's
Hook
? The javascript code is exactly the same as the android platform and it works perfectly on that one

Answer Source

Yes. The message you are seeing is written at line 107

It is due switch case starting from 99

switch (platform) {
case 'android':
    platformPath = path.join(platformPath, platform, "assets", "www");
    break;
case 'ios':
    platformPath = path.join(platformPath, platform, "www");
    break;
default:
    console.log('Hook currently supports only Android and iOS');
    return;
}

if you know the path for browser platform. you can add another case for browser platform after that it should work.

Here are the steps you can follow to make the changes

  1. fork repo
  2. clone. make changes. commit it.
  3. Use this new module into your cordova project

Consider making an pull request to original so that others can solve their problem

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download