forked from reshadi/jakets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClosure.js
28 lines (28 loc) · 1020 Bytes
/
Closure.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
var Path = require("path");
var Jake = require("./Jake");
var Node = require("./Node");
var ClosureJar = Node.FindModulePath("google-closure-compiler/compiler.jar", [".."]);
var RawExec = Node.CreateExec("java -jar " + ClosureJar);
function Exec(inputs, output, callback, options) {
var args = "";
//Default arguments that can be overwritten via options
args += " --compilation_level ADVANCED_OPTIMIZATIONS";
args += " --language_in ECMASCRIPT5";
args += " --new_type_inf";
args += " --summary_detail_level 3";
args += " --warning_level VERBOSE";
args += " --js_output_file=" + output;
// args += " --jszip=" + output + ".gz";
if (options) {
args += " " + options;
}
args += " " + inputs;
Jake.Shell.mkdir("-p", Path.dirname(output));
// RawExec(args, callback);
RawExec(args, function () {
Jake.Exec("gzip --best < " + output + " > " + output + ".gz", callback);
});
}
exports.Exec = Exec;
//# sourceMappingURL=Closure.js.map