<NME> pluginloader.js
<BEF> // Loads all the cordova plugins
module.exports = function(global) {
    // Load each plugin
    var pluginList = require('cordova/plugin_list');

    function initializeSymbol(value) {
        return function(symbol) {
            var parts = symbol.split('.');
            var top = global;
            for (var i = 0; i < parts.length - 1; i++) {
                if (typeof top[parts[i]] === 'undefined') {
                    top[parts[i]] = {};
                }
                top = top[parts[i]];
            }
            top[parts[parts.length - 1]] = value;
        }
    }

    pluginList.forEach(function(pluginData) {
        try {
            var plugin = require(pluginData.id);
            if (typeof pluginData.clobbers !== 'undefined') {
                pluginData.clobbers.forEach(initializeSymbol(plugin));
            }
        } catch (e) {
            console.error('Error loading Plugin %s', pluginData.id, e);
        }
    });

    //TODO Implement merges in addition to clobbers
};

    // FIX for plugins like ionic-plugin-keyboard that assume that 
    // cordova is always available on window object. This is not always true
    if (context.cordova) {
        for (var key in context.cordova) {
            if (typeof context[key] !== 'undefined') {
                console.error('cordova[' + key + '] is already defined, the plugin is trying to re-define it');
            } else {
                context[key] = context.cordova[key];
            }
        }
    }
    // END of fix

    setTimeout(function() {
        channel.onPluginsReady.fire();
    }, 0);
};

<MSG> Use modules loader for JS plugins

<DFF> @@ -1,32 +1,31 @@
 // Loads all the cordova plugins
-module.exports = function(global) {
+module.exports = function() {
     // Load each plugin
     var pluginList = require('cordova/plugin_list');
+    var modulemapper = require('cordova/modulemapper');
+    pluginList.forEach(function(module) {
+        try {
+            if (module.clobbers && module.clobbers.length) {
+                for (var j = 0; j < module.clobbers.length; j++) {
+                    modulemapper.clobbers(module.id, module.clobbers[j]);
+                }
+            }
 
-    function initializeSymbol(value) {
-        return function(symbol) {
-            var parts = symbol.split('.');
-            var top = global;
-            for (var i = 0; i < parts.length - 1; i++) {
-                if (typeof top[parts[i]] === 'undefined') {
-                    top[parts[i]] = {};
+            if (module.merges && module.merges.length) {
+                for (var k = 0; k < module.merges.length; k++) {
+                    modulemapper.merges(module.id, module.merges[k]);
                 }
-                top = top[parts[i]];
             }
-            top[parts[parts.length - 1]] = value;
-        }
-    }
 
-    pluginList.forEach(function(pluginData) {
-        try {
-            var plugin = require(pluginData.id);
-            if (typeof pluginData.clobbers !== 'undefined') {
-                pluginData.clobbers.forEach(initializeSymbol(plugin));
+            // Finally, if runs is truthy we want to simply require() the module.
+            if (module.runs) {
+                modulemapper.runs(module.id);
             }
+
+            modulemapper.mapModules(cordova);
+
         } catch (e) {
-            console.error('Error loading Plugin %s', pluginData.id, e);
+            console.error('Error loading Plugin %s', module.id, e);
         }
     });
-
-    //TODO Implement merges in addition to clobbers
 };

Use modules loader for JS plugins