You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/15 01:07:01 UTC

[1/2] git commit: Allow plugin modules to be .json files

Repository: cordova-lib
Updated Branches:
  refs/heads/master 6e1e3d95c -> 1cf81044a


Allow plugin modules to be .json files


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/28b372e1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/28b372e1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/28b372e1

Branch: refs/heads/master
Commit: 28b372e1952131e18dcfa679694bd523a3e46e20
Parents: 190eb20
Author: Joseph Frazier <jo...@onsip.com>
Authored: Thu Aug 7 10:06:39 2014 -0400
Committer: Joseph Frazier <jo...@onsip.com>
Committed: Thu Aug 7 10:06:57 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/prepare.js | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/28b372e1/cordova-lib/src/plugman/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/prepare.js b/cordova-lib/src/plugman/prepare.js
index 961141e..6083cbf 100644
--- a/cordova-lib/src/plugman/prepare.js
+++ b/cordova-lib/src/plugman/prepare.js
@@ -150,6 +150,9 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
 
             var fsPath = path.join.apply(path, pathParts);
             var scriptContent = fs.readFileSync(path.join(pluginDir, fsPath), 'utf-8').replace(/^\ufeff/, ''); // Window BOM
+            if (fsPath.match(/.*\.json$/)) {
+                scriptContent = 'module.exports = ' + scriptContent;
+            }
             scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) { ' + scriptContent + '\n});\n';
             fs.writeFileSync(path.join(platformPluginsDir, plugin_id, fsPath), scriptContent, 'utf-8');
             if(platform == 'wp8' || platform == 'windows8') {


[2/2] git commit: Merge branch 'exportJSON' of https://github.com/joseph-onsip/cordova-lib

Posted by pu...@apache.org.
Merge branch 'exportJSON' of https://github.com/joseph-onsip/cordova-lib


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/1cf81044
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/1cf81044
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/1cf81044

Branch: refs/heads/master
Commit: 1cf81044a77b3099e9bc41cb87670da1cdde6db9
Parents: 6e1e3d9 28b372e
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Aug 14 16:07:04 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Aug 14 16:07:04 2014 -0700

----------------------------------------------------------------------
 cordova-lib/src/plugman/prepare.js | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------