ESC之ESC.wsf可以实现javascript的代码压缩附使用方法第3/5页
更新时间:2007年05月07日 00:00:00 作者:
可以对javascript的大小进行压缩。使javascript的加载速度变快。
Commandline options |
There are a set of options available to provide full control of how you want your source files treated. This list is also available by running ESC with the -help option, but I'll try to explain some of them here more indepth. |
|
- -l (level) Sets the crunch-level you wish to use in the range of 0-4. If this option is not set, level 2 is assumed.
- -s (silent) Produce no report and no error messages whatsoever.
- -v (verbose) When verbose mode is enabled, ESC will echo every action performed back to the console. This comes in handy when debugging or if you just want to view the process taking place. By using > you can even pipe the verbosed output to a logfile or similar. Ex. cscript ESC.wsf -v -ow all.js C:\script-dir > verbose.log
- -$ This option explicitly instructs ESC to activate the variable-substitution engine. The substition engine is the man doing the dirtywork at level 4, responsible for the most complex part of the crunching process, but by using this option ESC can be told to use it on lower levels also. For instance, using the option-combo -l 0 -$ would leave your scripts unprocessed in terms of whitespace and comments, but any variable-name not recognized as blessed will be mangled within a global scope.
- -oa <filename> With this directive you are telling ESC to append the crunched data to the file specified. If the specified file doesn't exist, ESC will create it.
- -ow <filename> | STDOUT Same as with -ao, but with the difference that ESC will write the output to the file specified instead of appending. This option will cause any previous file with the same name to be overwritten, so be careful. Optionally you can instruct ESC to write the stream to STDOUT instead of a file. Comes in handy if you are piping the output to another process.
|
|
----------------------------------------------------------- Usage : ESC.wsf -l [0-4] -ow output.js foo.js bar.js C:\scripts\baz ----------------------------------------------------------- -a [-about] : Description page -c [-copyright] : Copyright/license notice -e [-example] : Examples of usage -h [-help] : This help-screen ----------------------------------------------------------- -l [-level] [01(2)34] : [optional] Set crunch-level (4 sets -$ on) -s [-silent] : [optional] Run silent, nada stdout -v [-verbose] : [optional] Run in verbose mode -$ : [optional] Activate variable-substitution engine ----------------------------------------------------------- -oa <filename> : Target filename for appending -ow <filename> : Target filename for writing -ow STDOUT : Write stream to STDOUT ----------------------------------------------------------- <input-file(s)> : [required] file(s) and/or directories containing scripts to crunch... (If filenames contains spaces, they must be quoted) |
相关文章
js图片轮播手动切换特效
这篇文章主要为大家详细介绍了js图片轮播手动切换特效,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
2017-01-01
Json按某个键的值进行排序
这篇文章主要介绍了json按某个键的值进行排序的相关资料,代码简单易懂,非常不错,需要的朋友可以参考下
2016-12-12
五段实用的js高级技巧
五段实用的js高级技巧,一些不错的小技巧,学习js的朋友可以看看。
2011-12-12
小程序实现搜索框功能
这篇文章主要为大家详细介绍了小程序实现搜索框功能,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
2019-07-07
最新评论