ESC之ESC.wsf可以实现javascript的代码压缩附使用方法第4/5页

 更新时间:2007年05月07日 00:00:00   作者:  
可以对javascript的大小进行压缩。使javascript的加载速度变快。


Examples of usage 
X:\cscript ESC.wsf -ow crunched.js original1.js original2.js original3.js Crunch 'original1.js','original2.js' and 'original3.js' at level 2 (default) and save the output as 'crunched.js'. Any previous file named 'crunched.js' will be overwritten. 
X:\cscript ESC.wsf -l 1 -oa crunched.js C:\script-directory Grab all scriptfiles (.js) in directory 'C:\script-directory', crunch them at level 1 (comment and empty line removal only) and append the result to 'crunched.js'. If 'crunched.js' doesn't exist, it will be created. 
X:\cscript ESC.wsf -l 0 -$ -ow STDOUT original1.js original2.js Subject 'original1.js' and 'original2.js' for variable substitution, but perform no comment or whitespace removal. Redirect output to STDOUT instead of writing to file. 
X:\cscript ESC.wsf -l 4 -ow crunched.js original.js Crunch 'original.js' using variable substitution and remove any occurance of whitespace (where permitted...) and save it as 'crunched.js' (equals -l 3 -$) 
X:\cscript ESC.wsf -l 4 -ow crunched.js original.js > verbose.txt Crunch 'original.js' at level 4 and save the verbose output to verbose.txt  

相关文章

最新评论