From 6e25a6b059ac4d8a246541df2978c82587b300ec Mon Sep 17 00:00:00 2001 From: guybedford Date: Wed, 22 Oct 2014 12:36:18 +0200 Subject: [PATCH] maping fix, config ordering fix, beta.12 --- lib/build.js | 1 + lib/config/package.js | 3 ++- lib/core.js | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/build.js b/lib/build.js index 60f7e8182..f2ff6505e 100644 --- a/lib/build.js +++ b/lib/build.js @@ -466,6 +466,7 @@ exports.compileDir = function(dir, options) { else if (format == 'cjs') { source = source.replace(cjsRequireRegEx, function(statement, singleString, doubleString) { var name = singleString || doubleString; + name = name.substr(1, name.length - 2); var mapped = applyMap(name, map, relFile, options.removeJSExtensions); if (!mapped) diff --git a/lib/config/package.js b/lib/config/package.js index db606804e..e7731e02c 100644 --- a/lib/config/package.js +++ b/lib/config/package.js @@ -156,11 +156,12 @@ PackageJSON.prototype.write = function() { if (!hasProperties(pjson.map)) delete pjson.map; - // reuse existing package.json dependencies if possible to maintain ordering pjson.dependencies = {}; var depValue; for (var d in this.dependencies) { var dep = this.dependencies[d]; + if (!dep) + continue; var regName; // github:some/thing: x.y.z if (d == dep.name) diff --git a/lib/core.js b/lib/core.js index 7f1f88584..fd2a6304e 100644 --- a/lib/core.js +++ b/lib/core.js @@ -105,7 +105,7 @@ function removePackage(name) { // remove from config.pjson.dependencies if (config.pjson.dependencies[name] && (removed = true)) - delete config.pjson.dependencies[name]; + config.pjson.dependencies[name] = undefined; if (!config.loader.baseMap[name]) return removed; diff --git a/package.json b/package.json index 98fac6dc3..7802f307f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jspm", "description": "", - "version": "0.8.0-beta.11", + "version": "0.8.0-beta.12", "main": "./api.js", "author": "", "dependencies": {