mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
create require aliases for plugins
This commit is contained in:
parent
b5b6255302
commit
bb5cfce7e9
@ -154,21 +154,25 @@ define(function(require, exports, module) {
|
||||
});
|
||||
}
|
||||
|
||||
var pathConfig = {};
|
||||
|
||||
pathConfig["plugins/" + name] = host + join(base, name);
|
||||
// Add the plugin to the config
|
||||
Object.keys(options.plugins).forEach(function(path){
|
||||
var pluginPath = name + "/" + path + ".js";
|
||||
|
||||
// Watch project path
|
||||
watch("~/.c9/plugins/" + pluginPath);
|
||||
|
||||
var cfg = options.plugins[path];
|
||||
cfg.packagePath = host + join(base, pluginPath.replace(/^plugins\//, ""));
|
||||
cfg.packagePath = "plugins/" + name + "/" + path;
|
||||
cfg.staticPrefix = host + join(base, name);
|
||||
cfg.apikey = "0000000000000000000000000000=";
|
||||
|
||||
config.push(cfg);
|
||||
});
|
||||
|
||||
requirejs.config({paths: pathConfig});
|
||||
|
||||
next();
|
||||
});
|
||||
},
|
||||
|
||||
@ -68,7 +68,7 @@ define(function(require, exports, module) {
|
||||
var path = options.packagePath + ".js";
|
||||
var host = vfs.baseUrl + "/";
|
||||
var base = join(String(c9.projectId), "plugins", auth.accessToken);
|
||||
|
||||
|
||||
options.packagePath = host + join(base, path.replace(/^plugins\//, ""));
|
||||
options.staticPrefix = host + join(base, name);
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ function plugin(options, imports, register) {
|
||||
token: req.params.token
|
||||
});
|
||||
|
||||
opts.options.debug = req.params.debug;
|
||||
opts.options.debug = req.params.debug == 1;
|
||||
res.setHeader("Cache-Control", "no-cache, no-store");
|
||||
res.render(__dirname + "/views/standalone.html.ejs", {
|
||||
architectConfig: getConfig(configType, opts),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user