You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/07/21 01:34:54 UTC
js commit: Fixed issues with data transforms when using browserify
Repository: cordova-js
Updated Branches:
refs/heads/master eb620e293 -> e483adc8b
Fixed issues with data transforms when using browserify
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/e483adc8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/e483adc8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/e483adc8
Branch: refs/heads/master
Commit: e483adc8bcd703de8a69f227e7e8d3424f60bf98
Parents: eb620e2
Author: Suraj Pindoria <su...@yahoo.com>
Authored: Thu Jul 16 16:00:21 2015 -0700
Committer: Suraj Pindoria <su...@yahoo.com>
Committed: Thu Jul 16 16:00:21 2015 -0700
----------------------------------------------------------------------
tasks/lib/require-tr.js | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/e483adc8/tasks/lib/require-tr.js
----------------------------------------------------------------------
diff --git a/tasks/lib/require-tr.js b/tasks/lib/require-tr.js
index ac7f614..d287f79 100644
--- a/tasks/lib/require-tr.js
+++ b/tasks/lib/require-tr.js
@@ -51,20 +51,35 @@ var requireTr = {
function end() {
var platform = platObj.platform;
// SOME BS pre-transforms
- if(data.match(/clobbers\('cordova\/plugin\/android\/app/)) {
+ if(data.match(/clobbers\("cordova\/plugin\/android\/app/)) {
// Checking for '\' from the windows path
root = root.replace(/\\/g, '/');
+ // new way that uses files from cordova-js-src
+ if (file.match(/android\/platform_www\/cordova-js-src\/platform.js$/) || file.match(/android\\platform_www\\cordova-js-src\\platform.js$/)) {
+ var androidPath = path.dirname(file).replace(/\\/g, '/');
+
+ data = data.replace(/modulemapper\.clobbers.*\n/,
+ util.format('navigator.app = require("%s/plugin/android/app.js");', androidPath));
+ } else if (file.match(/amazon-fireos\/platform_www\/cordova-js-src\/platform.js$/) || file.match(/amazon-fireos\\platform_www\\cordova-js-src\\platform.js$/)) {
+ var amazonfirePath = path.dirname(file).replace(/\\/g, '/');
+
+ data = data.replace(/modulemapper\.clobbers.*\n/,
+ util.format('navigator.app = require("%s/plugin/android/app.js");', amazonfirePath));
+ }
+
+
+ // the old way, keep as a fallback
if(file.match(/android\/platform.js$/) || file.match(/android\\platform.js$/)) {
data = data.replace(/modulemapper\.clobbers.*\n/,
- util.format('navigator.app = require("%s/src/legacy-exec/android/plugin/android/app")', root));
+ util.format('navigator.app = require("%s/src/legacy-exec/android/plugin/android/app");', root));
} else if (file.match(/amazon-fireos\/platform.js$/) || file.match(/amazon-fireos\\platform.js$/)) {
data = data.replace(/modulemapper\.clobbers.*\n/,
- util.format('navigator.app = require("%s/src/legacy-exec/amazon-fireos/plugin/android/app")', root));
+ util.format('navigator.app = require("%s/src/legacy-exec/amazon-fireos/plugin/android/app");', root));
}
}
- if(data.match(/clobbers\('cordova\/exec\/proxy/)) {
+ if(data.match(/clobbers\("cordova\/exec\/proxy/)) {
// Checking for '\' from the windows path
root = root.replace(/\\/g, '/');
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org