Updated Branches: refs/heads/pl [created] 16f2cf942
testing out plugin loader approach by jesse Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/16f2cf94 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/16f2cf94 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/16f2cf94 Branch: refs/heads/pl Commit: 16f2cf9425f79ff592206aef36aef27bb6b07b11 Parents: 7b63c0b Author: Fil Maj <[email protected]> Authored: Fri May 17 17:35:04 2013 -0700 Committer: Fil Maj <[email protected]> Committed: Fri May 17 17:35:04 2013 -0700 ---------------------------------------------------------------------- src/prepare.js | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/16f2cf94/src/prepare.js ---------------------------------------------------------------------- diff --git a/src/prepare.js b/src/prepare.js index 7f3df91..800c8e1 100644 --- a/src/prepare.js +++ b/src/prepare.js @@ -120,6 +120,9 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir) { }); // Write out moduleObjects as JSON to cordova_plugins.json - fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.json'), JSON.stringify(moduleObjects), 'utf-8'); + var final_contents = "cordova.define('cordova/plugin_list', function(require, exports, module) {\n"; + final_contents += 'module.exports = ' + JSON.stringify(moduleObjects) + '\n'; + final_contents += '});'; + fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.js'), final_contents, 'utf-8'); };
