手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >ESC之ESC.wsf可以实现javascript的代码压缩附使用方法第1/5页
ESC之ESC.wsf可以实现javascript的代码压缩附使用方法第1/5页
摘要:作用:可以对javascript的大小进行压缩。使javascript的加载速度变快。用法:在cmd下面输入的东西;cscriptESC.w...

作用:可以对javascript的大小进行压缩。使javascript的加载速度变快。

用法:

在 cmd下面输入的东西;

cscript ESC.wsf -l 3 -ow ../global.js global.js

上面是一个简单的例子:可以自己建一个bat文件放在当前目录下面

cscript ESC.wsf -l 压缩级别 -ow 。。/要压缩到那个目录 需要进行压缩的原js

1.

Level 0 :: No compression //没有处里

Level 1 :: Comment removal //删除掉注释

Level 3 :: Newline removal //删除掉新行

Level 4 :: Variable substitution //变量的替换

2.下图时所用到的参数:

-l 级别

-s

-v

-$

-oa 以追加的形式覆盖

-ow 以覆盖的形式覆盖

所用压缩包在附件 还有帮助文档

使用的例子见压缩包中的图片。

下载地址 http://xiazai.jb51.net/201003/yuanma/ESC.rar

Introduction

ESCisanECMAScriptpre-processorwritteninJScript,enablinganunlimitednumberofexternalscriptstobecompressed/crunchedintosupertight,bandwidth-optimizedpackages.Featuringseveralcompression-techniquessuchascommentremoval,whitespacestripping,newlinestrippingandvariablesubstitutionESCcanreducetheoverallsizeofyourcodewithupto~45%.Single,multiplescriptsandevendirectorieswithscriptscanbemergedtogetheratthecompressionlevelyoudecide.Theprocessedoutputcanlaterbeappendedorwrittentoafile,orpipedtoanotherapplicationforfurtherprocessingviaSTDOUT. ESCdoNOTsupportcrunchingofinlinescripts.SoanyattemptpassingHTML,ASP,JSP,PHPorotherequivalentdocumentstoESCisdoneatyourownrisk. ESCsupportsfourlevelsofcompression,whereahigherlevelequalshighercompression.Bewarethoughthatlevels>2requiresyourcodetobesyntaxicallyperfectorESCwillpunishyoubyproducingabrokenanduselessoutput. Thecompressionratioshouldhitaround25%usingthedefaultcompressionlevelonavanillalookingscript,butresultsashighas~45%canbeachieveddependingonthescript'sdesign/yourstyleofwritingcode. ESC'scompressionengineisintelligentinthemeaningthatithaslanguagesyntax,statementandkeywordawarenessandit*knows*aboutnativeobjectsandmembersprovidedbythemostcommonscriptinghosts.Thisknowledgebasecaneasilybeextendedbypluggininuserdefinedmapswithadditionalinformationtofurthergaincontrolofthecrunchingprocedure.Duringprocessingfollowingthingsaretakenintoaccount: StringandRegExpressionread-ahead

JScriptConditionalcompilationstatementsandvariables

ECMA-262Corelanguagedefinitions(ECMAScript)

IntermediateDOM's(level0)andDOMlevel1

MSJScriptspecificobjects/methods

Netscape/Mozilla/Operaspecificobjects/methods/properties

MSWSH(WindowsScriptingHost)1+nativeobjects

当前1/5页12345下一页阅读全文

【ESC之ESC.wsf可以实现javascript的代码压缩附使用方法第1/5页】相关文章:

javascript去除空格方法小结

使用RequireJS优化JavaScript引用代码的方法

简介JavaScript中的setTime()方法的使用

JavaScript的9种继承实现方式归纳

JavaScipt中Function()函数的使用教程

javascript动态创建链接的方法

简述JavaScript中正则表达式的使用方法

javaScript中with函数用法实例分析

javascript的函数第1/3页

怎么用javascript进行拖拽第1/2页

精品推荐
分类导航