c9-core/plugins/c9.static/unpacked_helper.js

39 wiersze
1.0 KiB
JavaScript
Czysty Zwykły widok Historia

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).
*/
"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;
assert(baseUrl, "baseUrl must be set");
assert(ideBaseUrl, "ideBaseUrl must be set");
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",
];
connectStatic.getRequireJsConfig().baseUrlLoadBalancers = balancers;
assert(connectStatic.getRequireJsConfig().baseUrlLoadBalancers);
register(null, {
"unpacked_helper": {}
});
}