UglifyJS 3
==========
UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit.
#### Note:
- **`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/UglifyJS2/tree/v2.x)**.
- **Documentation for UglifyJS `2.x` releases can be found [here](https://github.com/mishoo/UglifyJS2/tree/v2.x)**.
- `uglify-js` only supports JavaScript (ECMAScript 5).
- To minify ECMAScript 2015 or above, transpile using tools like [Babel](https://babeljs.io/).
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 parenthesis. Note: you may
want to disable `negate_iife` under
compressor options.
-o, --output <file> Output file path (default STDOUT). Specify `ast` or
`spidermonkey` to write UglifyJS or SpiderMonkey AST
as JSON to STDOUT respectively.
--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 sourcesContent property.
`root` Path to the original source to be included in
the source map.
`url` If specified, path to the source map to append in
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
软件开发设计:应用软件开发、系统软件开发、移动应用开发、网站开发C++、Java、python、web、C#等语言的项目开发与学习资料 硬件与设备:单片机、EDA、proteus、RTOS、包括计算机硬件、服务器、网络设备、存储设备、移动设备等 操作系统:LInux、树莓派、安卓开发、微机操作系统、网络操作系统、分布式操作系统等。此外,还有嵌入式操作系统、智能操作系统等。 网络与通信:数据传输、信号处理、网络协议、网络与通信硬件、网络安全网络与通信是一个非常广泛的领域,它涉及到计算机科学、电子工程、数学等多个学科的知识。 云计算与大数据:包括云计算平台、大数据分析、人工智能、机器学习等,云计算是一种基于互联网的计算方式,通过这种方式,共享的软硬件资源和信息可以按需提供给计算机和其他设备。
资源推荐
资源详情
资源评论
收起资源包目录
使用node搭建后台的学生列表项目.zip (921个子文件)
he.1 3KB
acorn 316B
acorn 59B
AUTHORS 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
ChangeLog 10KB
esgenerate.cmd 270B
escodegen.cmd 269B
esvalidate.cmd 268B
esparse.cmd 265B
uglifyjs.cmd 265B
html-minifier.cmd 263B
acorn.cmd 258B
mime.cmd 254B
he.cmd 252B
sample-cli-config-file.conf 1KB
bootstrap.css 144KB
bootstrap.min.css 120KB
bootstrap-theme.css 26KB
bootstrap-theme.min.css 23KB
.editorconfig 399B
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
escodegen 338B
esgenerate 340B
.eslintignore 5B
.eslintrc 647B
.eslintrc 422B
.eslintrc 180B
esparse 330B
esvalidate 336B
he 4KB
he 304B
edit.html 3KB
new.html 3KB
index.html 2KB
props.html 2KB
index.html 469B
include.html 19B
html-minifier 326B
esprima.js 277KB
compress.js 273KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 254KB
acorn.js 188KB
acorn.js 176KB
acorn.es.js 175KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
source-map.js 100KB
he.js 99KB
escodegen.js 93KB
bootstrap.js 67KB
parse.js 58KB
output.js 50KB
acorn-loose.js 49KB
acorn_loose.js 49KB
acorn_loose.es.js 47KB
htmlminifier.js 44KB
source-map-consumer.js 40KB
source-map-consumer.js 40KB
source-map-consumer.js 40KB
source-map-consumer.js 40KB
source-map-consumer.js 37KB
bootstrap.min.js 36KB
sbcs-data-generated.js 31KB
ast.js 31KB
code.js 29KB
index.js 27KB
index.js 27KB
parse.js 27KB
response.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
estraverse.js 26KB
compactable.js 25KB
tokenize.js 25KB
qs.js 24KB
stringify.js 24KB
index.js 23KB
mozilla-ast.js 23KB
break-up.js 21KB
dbcs-codec.js 21KB
optimize.js 21KB
scope.js 20KB
htmlparser.js 19KB
ipaddr.js 19KB
index.js 18KB
template-web.js 17KB
共 921 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功