forked from psiborg/PantherUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJakefile
54 lines (42 loc) · 1.81 KB
/
Jakefile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
desc("runs build");
task("default", ["build"], function () {});
desc("combines the source files");
task("build", [], function () {
console.log("Building PantherUI...");
var fs = require('fs'),
zlib = require('zlib'),
gzip = zlib.createGzip(),
ginp = "",
gout = '',
childProcess = require('child_process'),
outputCSS = "",
outputJS = "";
console.log(" - including Carousel.css");
outputCSS += fs.readFileSync("lib/modules/Carousel/Carousel.css", "utf-8");
console.log("writing: PantherUI.css");
fs.writeFileSync("dist/PantherUI.css", outputCSS);
console.log("minifying: PantherUI.css");
childProcess.exec("cleancss -o dist/PantherUI.min.css dist/PantherUI.css", complete);
console.log("gzipping: PantherUI.min.css");
//setTimeout(function(){
ginp = fs.createReadStream('dist/PantherUI.min.css');
gout = fs.createWriteStream('dist/PantherUI.min.css.gz');
ginp.pipe(gzip).pipe(gout);
console.log("Build CSS Complete.");
//}, 2000);
console.log(" - including Panther.js");
outputJS += fs.readFileSync("lib/Panther.js", "utf-8");
console.log(" - including Panther.Carousel.js");
outputJS += fs.readFileSync("lib/modules/Carousel/Panther.Carousel.js", "utf-8");
console.log("writing: PantherUI.js");
fs.writeFileSync("dist/PantherUI.js", outputJS);
console.log("minifying: PantherUI.js");
childProcess.exec("uglifyjs dist/PantherUI.js > dist/PantherUI.min.js", complete);
console.log("gzipping: PantherUI.min.js");
//setTimeout(function(){
ginp = fs.createReadStream('dist/PantherUI.min.js');
gout = fs.createWriteStream('dist/PantherUI.min.js.gz');
ginp.pipe(gzip).pipe(gout);
console.log("Build JS Complete.");
//}, 4000);
}, true);