This commit is contained in:
Vanessa
2012-07-25 16:30:35 +08:00
parent 4f1239a039
commit 963d609e62
2 changed files with 32 additions and 52 deletions

View File

@@ -1,24 +1,17 @@
/*var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify;
var orig_code = "... JS code here";
var ast = jsp.parse(orig_code); // parse code and get the initial AST
ast = pro.ast_mangle(ast); // get a new AST with mangled names
ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
var final_code = pro.gen_code(ast); // compressed code here
// js compress
var jsPaths = ["../neoease/js/neoease.js"]*/
// css compress
var fs = require("fs"),
exec = require("child_process").exec;
// js compress
var jsPaths = ["neoease"];
for (var i = 0; i < jsPaths.length; i++) {
var content = "";
exec("uglifyjs ../../" + jsPaths[i] + "/js/" + jsPaths[i] + ".js > ../../" + jsPaths[i] + "/js/" + jsPaths[i] + ".min.js", function (error, stdout, stderr) {
if (error !== null) {
console.log(error);
}
});
}
// css compress
var skinsCsses = ["andrea", "classic", "community", "favourite", "i-nove", "neoease", "owmx-3.0", "tree-house"];
for (var i = 0; i < skinsCsses.length; i++) {
@@ -28,36 +21,4 @@ for (var i = 0; i < skinsCsses.length; i++) {
console.log(error);
}
});
}
/*
var fs = require("fs");
var less = require('C:\\Users\\Vanessa\\AppData\\Roaming\\npm\\node_modules\\less');
var parser = new(less.Parser)();
fs.readFile('../../andrea/css/andrea.css', 'UTF-8', function (err, data) {
if (err) throw err;
new(less.Parser)({
paths: ["../../andrea/css"],
filename: "andrea.css"
}).parse(data, function (e, root) {
var result = root.toCSS({ compress: true });
console.log(result);
});
});
/*var cssPaths = ["../andrea/css/andrea.css", "../classic/css/classic.css",
"../community/css/community.css", "../favourite/css/favourite.css",
"../i-nove/css/i-nove.css", "../neoease/css/neoease.css",
"../owmx-3.0/css/owmx-3.0.css", "../terr-house/css/tree-house.css"];
for (var i = 0; i < cssPaths.lengtg; i++) {
}*/
}