2015-11-17 11:40:34 +00:00
|
|
|
/**
|
|
|
|
* unpacked_helper speeds up the unpacked version of Cloud9
|
|
|
|
* by using more parallel connections and avoiding
|
|
|
|
* subsubdomains on dogfooding (e.g., ide.dev-lennartcl.c9.io, where
|
|
|
|
* Chrome doesn't support any caching).
|
|
|
|
*/
|
2015-06-21 10:11:10 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
plugin.consumes = [
|
|
|
|
"db", "connect.static"
|
|
|
|
];
|
|
|
|
plugin.provides = [
|
|
|
|
"unpacked_helper"
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = plugin;
|
|
|
|
|
|
|
|
function plugin(options, imports, register) {
|
|
|
|
var connectStatic = imports["connect.static"];
|
|
|
|
var assert = require("assert");
|
|
|
|
var baseUrl = options.baseUrl;
|
|
|
|
var ideBaseUrl = options.ideBaseUrl;
|
2015-07-07 08:04:43 +00:00
|
|
|
assert(baseUrl, "baseUrl must be set");
|
|
|
|
assert(ideBaseUrl, "ideBaseUrl must be set");
|
2015-06-21 10:11:10 +00:00
|
|
|
|
2015-06-21 12:05:16 +00:00
|
|
|
var balancers = [
|
2015-11-17 11:40:34 +00:00
|
|
|
baseUrl + "/_unp",
|
2015-11-18 08:29:11 +00:00
|
|
|
baseUrl + ":8080/_unp",
|
2015-11-17 11:40:34 +00:00
|
|
|
baseUrl + ":8081/_unp",
|
|
|
|
baseUrl + ":8082/_unp",
|
2015-06-21 10:11:10 +00:00
|
|
|
];
|
|
|
|
|
2015-06-21 12:05:16 +00:00
|
|
|
connectStatic.getRequireJsConfig().baseUrlLoadBalancers = balancers;
|
|
|
|
assert(connectStatic.getRequireJsConfig().baseUrlLoadBalancers);
|
2015-06-21 10:11:10 +00:00
|
|
|
|
|
|
|
register(null, {
|
|
|
|
"unpacked_helper": {}
|
|
|
|
});
|
|
|
|
}
|