From 0f9d20129dc43d36e45f818c77577fdcc1552eab Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 14 Jul 2013 13:10:46 -0700 Subject: [PATCH] Ensure category modules reference dependencies with relative paths. Former-commit-id: 5a12a4b2f4cd3a56456238303e7d941b06f76d9f --- build.js | 7 +++++-- test/index.html | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index 7bafac8f6..2d8f34e24 100644 --- a/build.js +++ b/build.js @@ -829,8 +829,11 @@ fromPath || (fromPath = ''); return dependencies.map(function(depName) { var toPath = getPath(depName), - relative = (path.relative(fromPath, toPath) || '.').replace(RegExp(path.sepEscaped, 'g'), sep); + relative = path.relative(fromPath, toPath).replace(RegExp(path.sepEscaped, 'g'), sep); + if (relative.charAt(0) != '.') { + relative = '.' + (relative ? sep + relative : ''); + } return relative + sep + depName; }); }; @@ -899,7 +902,7 @@ (function() { var deps = _.invoke(categories, 'toLowerCase'), depArgs = deps.join(', '), - depPaths = "['" + deps.join("', './") + "'], ", + depPaths = "['" + (deps.length ? './' + deps.join("', './") : '') + "'], ", iife = []; if (isAMD) { diff --git a/test/index.html b/test/index.html index 0af34d0b7..6372bb415 100644 --- a/test/index.html +++ b/test/index.html @@ -69,7 +69,6 @@ 'test.js' ); - console.log(testPath) QUnit.config.autostart = false; // load Lo-Dash as a module