uglify-es
=========
A JavaScript parser, mangler/compressor and beautifier toolkit for ES6+.
#### Note:
- **`uglify-es` is API/CLI compatible with `uglify-js@3`.**
- **`uglify-es` is not backwards compatible with `uglify-js@2`.**
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-es -g
From NPM for programmatic use:
npm install uglify-es
# 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.
--ecma <version> Specify ECMAScript release: 5, 6, 7 or 8.
--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-classnames Do not mangle/drop class names.
--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.
--safari10 Support non-standard Safari 10/11.
Equivalent to setting `safari10: true` in `minify()`
for `mangle` and `output` options.
By default `uglify-es` will not work around
Safari 10/11 bugs.
--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` Name and/or location of the output source.
`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
`//# sourceMappingURL`.
--timings Disp
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
在准备看一个开源项目源码的时候先去熟悉下这个项目的背景、功能以及相应的API。这步为了理解整个项目的功能做准备,也是为了后面重点看哪些模块做准备 查看项目的README.md文件。有些项目会在将设计文档和架构图放到md文件上,这样会让你宏观上对一些概念有些认识。例如immer查看项目整体的文件结构。比如下面提到一些重点需要查看的文件package.json,可以从这个文件看到整个项目的入口文件、开发/测试/发布编译的各种命令,也可以了解到项目的依赖库、工具以及框架等等。 webpack/gulp/rollup配置文件,从这个文件里面可以看到项目整体的工具配置,也包含入口文件以及编译之后的代码文件,以及一些配置项的功能知道一些默认命名的文件规则,比如e2e,端对端测试unit,单元测试index.xx,一般会用来作为前端的入口文件app.xx、server.xx,一般会用来做后端的入口文件dist,表示编译之后的源文件src,源代码文件 static,静态文件,前端项目一般都会用来作为给浏览器运行的入口文件test,测试用例文件夹,在你阅读的过程中,如果发现一些代码片段很精妙的可以记录
资源推荐
资源详情
资源评论
收起资源包目录
前端vue源码(附有详细代码) (894个子文件)
acorn 270B
acorn 62B
range.bnf 619B
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
ChangeLog 10KB
html-beautify.cmd 218B
css-beautify.cmd 216B
js-beautify.cmd 214B
editorconfig.cmd 206B
esgenerate.cmd 202B
cssbeautify.cmd 202B
escodegen.cmd 200B
esvalidate.cmd 198B
esparse.cmd 192B
uglifyjs.cmd 192B
semver.cmd 182B
nopt.cmd 180B
acorn.cmd 178B
vm2.cmd 170B
css-beautify 308B
cssbeautify 2KB
cssbeautify 294B
editorconfig 298B
editorconfig 78B
escodegen 292B
esgenerate 294B
.eslintignore 33B
esparse 284B
esvalidate 290B
props.html 2KB
tslib.es6.html 36B
tslib.html 32B
html-beautify 310B
geek_road.jpg 9KB
csstree.js 432KB
esprima.js 277KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
compress.js 264KB
acorn.js 213KB
beautifier.js 213KB
csstree.min.js 164KB
beautify.js 144KB
parse.js 107KB
beautify-html.js 107KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
beautifier.min.js 100KB
escodegen.js 93KB
index.js 91KB
index.js 78KB
named-entity-data.js 72KB
output.js 64KB
beautifier.js 55KB
beautify-css.js 51KB
ast.js 41KB
source-map-consumer.js 40KB
source-map-consumer.js 40KB
source-map-consumer.js 40KB
semver.js 38KB
Tokenizer.js 35KB
beautifier.js 34KB
resolver.js 33KB
fnmatch.js 30KB
code.js 29KB
events.js 27KB
index.js 27KB
bridge.js 27KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
minimatch.js 26KB
index.js 26KB
estraverse.js 26KB
manipulation.js 26KB
traversing.js 25KB
scope.js 25KB
cli.js 24KB
cli.js 24KB
index.js 23KB
wuWxml.js 22KB
mozilla-ast.js 22KB
match.js 19KB
tokenizer.js 19KB
glob.js 19KB
attributes.js 19KB
index.js 18KB
generic.js 16KB
nodevm.js 16KB
parse.js 16KB
walk.js 16KB
beautifier.js 15KB
cssbeautify.js 15KB
Lexer.js 15KB
List.js 15KB
共 894 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
c++服务器开发
- 粉丝: 3042
- 资源: 4463
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功