Skip to content

Commit

Permalink
Merge branch 'exportJSON' of https://github.com/joseph-onsip/cordova-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Aug 14, 2014
2 parents 6e1e3d9 + 28b372e commit 1cf8104
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cordova-lib/src/plugman/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 1cf8104

Please sign in to comment.