diff --git a/node_modules/architect-build/build_support/mini_require.js b/node_modules/architect-build/build_support/mini_require.js index 861835a0..b2075b0c 100644 --- a/node_modules/architect-build/build_support/mini_require.js +++ b/node_modules/architect-build/build_support/mini_require.js @@ -1,4 +1,3 @@ -console.time("req"); (function() { var MODULE_LOAD_URL = "/load/module"; @@ -288,40 +287,34 @@ require.MODULE_LOAD_URL = MODULE_LOAD_URL; require.toUrl = function(moduleName, ext, skipExt) { var absRe = /^([\w\+\.\-]+:|\/)/; - if (config.baseUrl) { - var index = moduleName.indexOf("!"); - if (index !== -1 || !ext) - ext = ""; - - var paths = config.paths; - var pkgs = config.packages; + var index = moduleName.indexOf("!"); + if (index !== -1 || !ext) + ext = ""; - var testPath = moduleName, tail = ""; - while (testPath) { - if (paths[testPath]) { - moduleName = paths[testPath] + tail; - break; - } - if (pkgs[testPath]) { - moduleName = pkgs[testPath].location + (tail || pkgs[testPath].main); - break; - } - var i = testPath.lastIndexOf("/"); - if (i === -1) break; - tail = testPath.substr(i) + tail; - testPath = testPath.slice(0, i); + var paths = config.paths; + var pkgs = config.packages; + + var testPath = moduleName, tail = ""; + while (testPath) { + if (paths[testPath]) { + moduleName = paths[testPath] + tail; + break; } - - var url = moduleName + ext; - if (!absRe.test(url)) url = config.baseUrl + url; - - return url; + if (pkgs[testPath]) { + moduleName = pkgs[testPath].location + (tail || pkgs[testPath].main); + break; + } + var i = testPath.lastIndexOf("/"); + if (i === -1) break; + tail = testPath.substr(i) + tail; + testPath = testPath.slice(0, i); } - var path = moduleName; - if (!absRe.test(path)) - path = require.MODULE_LOAD_URL + "/" + path + (ext || ""); - return path; + var url = moduleName + ext; + if (!absRe.test(url)) { + url = (config.baseUrl || require.MODULE_LOAD_URL + "/") + url; + } + return url; }; var loadScript = function(path, id, callback) { diff --git a/node_modules/architect-build/module-deps.js b/node_modules/architect-build/module-deps.js index 0f9a78e9..22355285 100644 --- a/node_modules/architect-build/module-deps.js +++ b/node_modules/architect-build/module-deps.js @@ -304,7 +304,7 @@ function resolveModuleId(id, paths) { if (typeof alias == "string") { return alias + tail; } else if (alias) { - return alias.location + (tail || alias.main || alias.name); + return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name); } else if (alias === false) { return ""; } @@ -375,17 +375,15 @@ function wrapUMD(module) { + ' if (typeof name == "function") {\n' + ' m = name; deps = ["require", "exports", "module"]; name = _.module.id\n' + ' }\n' - + ' if (typeof name == "object") {\n' + + ' if (typeof name !== "string") {\n' + ' m = deps; deps = name; name = _.module.id\n' + ' }\n' - + ' if (typeof deps == "function") {\n' + + ' if (!m) {\n' + ' m = deps; deps = [];\n' + ' }\n' - + ' if (typeof m != "function") {\n' - + ' deps = m; m = null;\n' - + ' }\n' - + ' var ret = m ? m.apply(_.module, deps.map(function(n){return _[n] || require(n)})) : deps\n' - + ' if (ret) _.module.exports = ret;\n' + + ' var ret = typeof m == "function" ?\n' + + ' m.apply(_.module, deps.map(function(n){return _[n] || require(n)})) : m\n' + + ' if (ret != undefined) _.module.exports = ret;\n' + '}\n' + 'define.amd = true;' + module.source diff --git a/plugins/c9.ide.plugins/debug.js b/plugins/c9.ide.plugins/debug.js index 4372a45a..a8974c77 100644 --- a/plugins/c9.ide.plugins/debug.js +++ b/plugins/c9.ide.plugins/debug.js @@ -187,8 +187,8 @@ define(function(require, exports, module) { // Remove the base path data = data.replace(rePath, ""); - if (data.indexOf("/__installed__.js")) - next("installed"); + if (data.indexOf("/__installed__.js") !== -1) + return next("installed"); // Process all the submodules var parallel = processModules(path, data, resourceHolder); diff --git a/plugins/c9.vfs.standalone/standalone.js b/plugins/c9.vfs.standalone/standalone.js index 357b3f35..83ddbf60 100644 --- a/plugins/c9.vfs.standalone/standalone.js +++ b/plugins/c9.vfs.standalone/standalone.js @@ -106,8 +106,7 @@ function plugin(options, imports, register) { var cdn = options.options.cdn; options.options.themePrefix = "/static/" + cdn.version + "/skin/" + configName; options.options.workerPrefix = "/static/" + cdn.version + "/worker"; - if (req.params.packed == 1) - options.options.CORSWorkerPrefix = "/static/" + cdn.version + "/worker"; + options.options.CORSWorkerPrefix = req.params.packed ? "/static/" + cdn.version + "/worker" : ""; var collab = options.collab && req.params.collab !== 0 && req.params.nocollab != 1; var opts = extend({}, options);