kopia lustrzana https://github.com/c9/core
Adding script to calculate what nodeModules are needed for a service. Used it to set nodeModulesInclude for api and ide
rodzic
8a0d2cfc16
commit
0f86040782
|
@ -188,19 +188,21 @@ dest = "/build/webkitbuilds/app.nw"
|
|||
var args = ["local","-s", "local"];
|
||||
*/
|
||||
module.exports = function(options, cb) {
|
||||
var dest = convertPath(options.dest);
|
||||
var dest = options.dest && convertPath(options.dest);
|
||||
var root = convertPath(options.root);
|
||||
var args = options.args;
|
||||
ignore = options.ignore && function(id) {
|
||||
return options.ignore.test(id);
|
||||
};
|
||||
build(root, args, function(err, result) {
|
||||
var serverSource = fs.readFileSync(root + "/server.js", "utf8");
|
||||
serverSource = serverSource.replace(/^(#.*|"use strict";?|\s)*/, function(a) {
|
||||
return a.trim() + "\n\n" + patchTemplate + "\n\n";
|
||||
});
|
||||
fs.writeFileSync(dest + "/server.js", serverSource, "utf8");
|
||||
fs.writeFileSync(dest + "/module-map.json", JSON.stringify(result.moduleMap), "utf8");
|
||||
if (dest) {
|
||||
var serverSource = fs.readFileSync(root + "/server.js", "utf8");
|
||||
serverSource = serverSource.replace(/^(#.*|"use strict";?|\s)*/, function(a) {
|
||||
return a.trim() + "\n\n" + patchTemplate + "\n\n";
|
||||
});
|
||||
fs.writeFileSync(dest + "/server.js", serverSource, "utf8");
|
||||
fs.writeFileSync(dest + "/module-map.json", JSON.stringify(result.moduleMap), "utf8");
|
||||
}
|
||||
|
||||
cb(null, result);
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue