重构文件目录
36
helper/compressor/grunt.js
Normal file
@ -0,0 +1,36 @@
|
||||
/*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 less = require('C:\\Users\\Vanessa\\AppData\\Roaming\\npm\\node_modules\\less');
|
||||
var parser = new(less.Parser)({
|
||||
paths: ['../*/css'], // Specify search paths for @import directives
|
||||
filename: '*.less' // Specify a filename, for better error messages
|
||||
});
|
||||
|
||||
parser.parse('.class { width: 1 + 1 }', function (e, tree) {
|
||||
tree.toCSS({ compress: true }); // Minify CSS output
|
||||
});
|
||||
|
||||
/*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++) {
|
||||
|
||||
}*/
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 970 KiB After Width: | Height: | Size: 970 KiB |
Before Width: | Height: | Size: 592 KiB After Width: | Height: | Size: 592 KiB |
Before Width: | Height: | Size: 646 KiB After Width: | Height: | Size: 646 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 830 KiB After Width: | Height: | Size: 830 KiB |
Before Width: | Height: | Size: 686 KiB After Width: | Height: | Size: 686 KiB |
Before Width: | Height: | Size: 792 KiB After Width: | Height: | Size: 792 KiB |
Before Width: | Height: | Size: 961 KiB After Width: | Height: | Size: 961 KiB |