UglifyJS 3
==========
UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit.
#### Note:
- `uglify-js` supports JavaScript and most language features in ECMAScript.
- For more exotic parts of ECMAScript, process your source file with transpilers
like [Babel](https://babeljs.io/) before passing onto `uglify-js`.
- `uglify-js@3` has a simplified [API](#api-reference) and [CLI](#command-line-usage)
that is not backwards compatible with [`uglify-js@2`](https://github.com/mishoo/UglifyJS/tree/v2.x).
Install
-------
First make sure you have installed the latest version of [node.js](http://nodejs.org/)
(You may need to restart your computer after this step).
From NPM for use as a command line app:
npm install uglify-js -g
From NPM for programmatic use:
npm install uglify-js
# Command line usage
uglifyjs [input files] [options]
UglifyJS can take multiple input files. It's recommended that you pass the
input files first, then pass the options. UglifyJS will parse input files
in sequence and apply any compression options. The files are parsed in the
same global scope, that is, a reference from a file to some
variable/function declared in another file will be matched properly.
If no input file is specified, UglifyJS will read from STDIN.
If you wish to pass your options before the input files, separate the two with
a double dash to prevent input files being used as option arguments:
uglifyjs --compress --mangle -- input.js
### Command line options
```
-h, --help Print usage information.
`--help options` for details on available options.
-V, --version Print version number.
-p, --parse <options> Specify parser options:
`acorn` Use Acorn for parsing.
`bare_returns` Allow return outside of functions.
Useful when minifying CommonJS
modules and Userscripts that may
be anonymous function wrapped (IIFE)
by the .user.js engine `caller`.
`expression` Parse a single expression, rather than
a program (for parsing JSON).
`spidermonkey` Assume input files are SpiderMonkey
AST format (as JSON).
-c, --compress [options] Enable compressor/specify compressor options:
`pure_funcs` List of functions that can be safely
removed when their return values are
not used.
-m, --mangle [options] Mangle names/specify mangler options:
`reserved` List of names that should not be mangled.
--mangle-props [options] Mangle properties/specify mangler options:
`builtins` Mangle property names that overlaps
with standard JavaScript globals.
`debug` Add debug prefix and suffix.
`domprops` Mangle property names that overlaps
with DOM properties.
`keep_quoted` Only mangle unquoted properties.
`regex` Only mangle matched property names.
`reserved` List of names that should not be mangled.
-b, --beautify [options] Beautify output/specify output options:
`beautify` Enabled with `--beautify` by default.
`preamble` Preamble to prepend to the output. You
can use this to insert a comment, for
example for licensing information.
This will not be parsed, but the source
map will adjust for its presence.
`quote_style` Quote style:
0 - auto
1 - single
2 - double
3 - original
`wrap_iife` Wrap IIFEs in parentheses. Note: you may
want to disable `negate_iife` under
compressor options.
-O, --output-opts [options] Specify output options (`beautify` disabled by default).
-o, --output <file> Output file path (default STDOUT). Specify `ast` or
`spidermonkey` to write UglifyJS or SpiderMonkey AST
as JSON to STDOUT respectively.
--annotations Process and preserve comment annotations.
(`/*@__PURE__*/` or `/*#__PURE__*/`)
--no-annotations Ignore and discard comment annotations.
--comments [filter] Preserve copyright comments in the output. By
default this works like Google Closure, keeping
JSDoc-style comments that contain "@license" or
"@preserve". You can optionally pass one of the
following arguments to this flag:
- "all" to keep all comments
- a valid JS RegExp like `/foo/` or `/^!/` to
keep only matching comments.
Note that currently not *all* comments can be
kept when compression is on, because of dead
code removal or cascading statements into
sequences.
--config-file <file> Read `minify()` options from JSON file.
-d, --define <expr>[=value] Global definitions.
-e, --enclose [arg[:value]] Embed everything in a big function, with configurable
argument(s) & value(s).
--ie8 Support non-standard Internet Explorer 8.
Equivalent to setting `ie8: true` in `minify()`
for `compress`, `mangle` and `output` options.
By default UglifyJS will not try to be IE-proof.
--keep-fnames Do not mangle/drop function names. Useful for
code relying on Function.prototype.name.
--name-cache <file> File to hold mangled name mappings.
--self Build UglifyJS as a library (implies --wrap UglifyJS)
--source-map [options] Enable source map/specify source map options:
`base` Path to compute relative paths from input files.
`content` Input source map, useful if you're compressing
JS that was generated from some other original
code. Specify "inline" if the source map is
included within the sources.
`filename` Filename and/or location of the output source
(sets `file` attribute in source map).
`includeSources` Pass this flag if you want to include
the content of source files in the
source map as sourcesCont
没有合适的资源?快使用搜索试试~ 我知道了~
我的VSCode(内含一些插件)
共2000个文件
py:777个
h:648个
md:260个
需积分: 0 0 下载量 129 浏览量
2023-09-18
08:11:11
上传
评论
收藏 787.45MB ZIP 举报
温馨提示
我的VSCode(内含一些插件)
资源推荐
资源详情
资源评论
收起资源包目录
我的VSCode(内含一些插件) (2000个子文件)
xxmodule.c 12KB
tkAppInit.c 4KB
pdb.doc 8KB
sqlite3.h 519KB
avx512fintrin.h 475KB
avx512vlintrin.h 413KB
bfd.h 257KB
basic_string.h 235KB
stl_algo.h 209KB
safestack.h 198KB
obj_mac.h 172KB
random.h 171KB
tclDecls.h 166KB
ssl.h 146KB
avx512vlbwintrin.h 140KB
vstring.h 108KB
avx512bwintrin.h 99KB
curses.h 97KB
ncurses.h 97KB
regex.h 94KB
tcl.h 93KB
locale_facets.h 90KB
avx512dqintrin.h 83KB
algo.h 78KB
stl_deque.h 77KB
tkDecls.h 74KB
unordered_map.h 74KB
stl_tree.h 73KB
hashtable.h 72KB
evp.h 71KB
random.h 71KB
multiway_merge.h 69KB
locale_facets_nonio.h 67KB
hashtable_policy.h 66KB
stl_list.h 66KB
asn1.h 62KB
avx512vldqintrin.h 60KB
stl_vector.h 59KB
unordered_set.h 58KB
tkIntXlibDecls.h 57KB
avx2intrin.h 57KB
tk.h 56KB
c++config.h 56KB
ec.h 55KB
shared_ptr_base.h 52KB
x509.h 52KB
keysymdef.h 52KB
stl_map.h 52KB
unicodeobject.h 51KB
emmintrin.h 50KB
avxintrin.h 49KB
stl_algobase.h 49KB
cursesw.h 49KB
forward_list.h 48KB
ropeimpl.h 47KB
objects.h 46KB
specfun.h 46KB
abstract.h 44KB
engine.h 44KB
expat.h 42KB
itclIntDecls.h 42KB
xmmintrin.h 41KB
stl_iterator.h 41KB
stl_function.h 41KB
stl_multimap.h 41KB
hashtable.h 41KB
bn.h 40KB
term.h 40KB
Xlib.h 40KB
x509v3.h 39KB
tls1.h 38KB
readline.h 38KB
object.h 38KB
bio.h 38KB
itclInt.h 37KB
pyconfig.h 37KB
avx512vbmi2vlintrin.h 35KB
stl_set.h 35KB
stl_multiset.h 35KB
ts.h 34KB
asn1t.h 34KB
bfdlink.h 34KB
hashtable.h 33KB
stl_bvector.h 33KB
ssl3.h 33KB
pyport.h 32KB
fs_path.h 32KB
shared_ptr.h 32KB
algorithmfwd.h 31KB
bitmap_allocator.h 31KB
sqlite3ext.h 31KB
mmintrin.h 31KB
ios_base.h 30KB
safe_iterator.h 30KB
rsa.h 29KB
x509_vfy.h 29KB
cms.h 28KB
demangle.h 28KB
losertree.h 28KB
xopintrin.h 28KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
Meteor_2007
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功