UglifyJS 2
==========
[![Build Status](https://travis-ci.org/mishoo/UglifyJS2.svg)](https://travis-ci.org/mishoo/UglifyJS2)
UglifyJS is a JavaScript parser, minifier, compressor or beautifier toolkit.
This page documents the command line utility. For
[API and internals documentation see my website](http://lisperator.net/uglifyjs/).
There's also an
[in-browser online demo](http://lisperator.net/uglifyjs/#demo) (for Firefox,
Chrome and probably Safari).
#### Note:
- `uglify-js` only supports ECMAScript 5 (ES5).
- Support for `const` is [present but incomplete](#support-for-const), and may not be
transformed properly.
- Those wishing to minify ES2015+ (ES6+) should use the `npm` package [**uglify-es**](https://github.com/mishoo/UglifyJS2/tree/harmony).
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
Usage
-----
uglifyjs [input files] [options]
UglifyJS2 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 you want to read from STDIN instead, pass a single dash instead of input
files.
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
The available options are:
```
--source-map Specify an output file where to generate source
map.
--source-map-root The path to the original source to be included
in the source map.
--source-map-url The path to the source map to be added in //#
sourceMappingURL. Defaults to the value passed
with --source-map.
--source-map-include-sources Pass this flag if you want to include the
content of source files in the source map as
sourcesContent property.
--source-map-inline Write base64-encoded source map to the end of js output.
--in-source-map 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
inline with the sources.
--screw-ie8 Use this flag if you don't wish to support
Internet Explorer 6/7/8.
By default UglifyJS will not try to be IE-proof.
--support-ie8 Use this flag to support Internet Explorer 6/7/8.
Equivalent to setting `screw_ie8: false` in `minify()`
for `compress`, `mangle` and `output` options.
--expr Parse a single expression, rather than a
program (for parsing JSON)
-p, --prefix Skip prefix for original filenames that appear
in source maps. For example -p 3 will drop 3
directories from file names and ensure they are
relative paths. You can also specify -p
relative, which will make UglifyJS figure out
itself the relative paths between original
sources, the source map and the output file.
-o, --output Output file (default STDOUT).
-b, --beautify Beautify output/specify output options.
-m, --mangle Mangle names/pass mangler options.
-r, --reserved Reserved names to exclude from mangling.
-c, --compress Enable compressor/pass compressor options, e.g.
`-c 'if_return=false,pure_funcs=["Math.pow","console.log"]'`
Use `-c` with no argument to enable default compression
options.
-d, --define Global definitions
-e, --enclose Embed everything in a big function, with a
configurable parameter/argument list.
--comments 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.
--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.
--stats Display operations run time on STDERR.
--acorn Use Acorn for parsing.
--spidermonkey Assume input files are SpiderMonkey AST format
(as JSON).
--self Build itself (UglifyJS2) as a library (implies
--wrap=UglifyJS --export-all)
--wrap Embed everything in a big function, making the
“exports” and “global” variables available. You
need to pass an argument to this option to
specify the name that your module will take
when included in, say, a browser.
--export-all Only used when --wrap, this tells UglifyJS to
add code to automatically export all globals.
--lint Display some scope warnings
-v, --verbose Verbose
-V, --version Print version number and exit.
--noerr Don't throw an error for unknown options in -c,
-b or -m.
--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`.
--keep-fnames Do not mangle/drop function names. Useful for
code relying on Function.prototype.name.
--reserved-file File containing reserved names
--reserve-domprops Make (most?) DOM properties reserved for
--mangle-props
--mangle-props Mangle property names (default `0`). Set to
`true` or `1` to mangle all property names. Set
to `unquoted` or `2` to onl
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
嵌入式优质项目,资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松copy复刻,拿到资料包后可轻松复现出一样的项目。 本人单片机开发经验充足,深耕嵌入式领域,有任何使用问题欢迎随时与我联系,我会及时为你解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明,项目具体内容可查看下方的资源详情。 【附带帮助】: 若还需要嵌入式物联网单片机相关领域开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步。 【本人专注嵌入式领域】: 有任何使用问题欢迎随时与我联系,我会及时解答,第一时间为你提供帮助,CSDN博客端可私信,为你解惑,欢迎交流。 【建议小白】: 在所有嵌入式开发中硬件部分若不会画PCB/电路,可选择根据引脚定义将其代替为面包板+杜邦线+外设模块的方式,只需轻松简单连线,下载源码烧录进去便可轻松复刻出一样的项目 【适合场景】: 相关项目设计中,皆可应用在项目开发、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面中 可借鉴此优质项目实现复刻,也可以基于此项目进行扩展来开发出更多功能
资源推荐
资源详情
资源评论
收起资源包目录
基于物联网设计的蔬菜大棚温湿度监控系统.zip(毕设/课设/竞赛/实训/项目开发) (1285个子文件)
acorn 3KB
acorn 2KB
AUTHORS 612B
AUTHORS 550B
cleancss 7KB
chunk-vendors.c6c21e4d.css 229KB
chunk-5c725d63.967eb350.css 237B
chunk-52809ff1.cddffa92.css 222B
chunk-58929426.9fa56cd4.css 185B
global.css 178B
style.css 111B
index.64eb8f2a.css 110B
chunk-7b7e582f.a6ba90bf.css 67B
chunk-e28a12e6.a6ba90bf.css 67B
chunk-4212a80f.09b8c64a.css 56B
chunk-7ef13cb1.c541115a.css 25B
.editorconfig 399B
.editorconfig 173B
.editorconfig 99B
.editorconfig 99B
.eslintignore 5B
.eslintrc 554B
.eslintrc 348B
.eslintrc 180B
.eslintrc 53B
.gitattributes 483B
.gitattributes 14B
.gitattributes 14B
.gitattributes 13B
.gitattributes 12B
.gitignore 214B
completion.sh.hbs 594B
index.html 2KB
props.html 2KB
index.html 557B
index.html 271B
block-code.html 0B
favicon.ico 4KB
favicon.ico 4KB
layout.jade 124B
error.jade 84B
index.jade 66B
chunk-vendors.d35bf674.js 1.62MB
bson.js 543KB
jade.js 261KB
source-map.debug.js 254KB
compress.js 175KB
acorn_csp.js 132KB
acorn.js 130KB
acorn.js 119KB
collection.js 110KB
source-map.js 100KB
compress.js 80KB
grid_store.js 65KB
q.js 63KB
parse.js 56KB
parse.js 49KB
replset.js 48KB
db.js 48KB
output.js 47KB
acorn_loose.js 44KB
mongos.js 42KB
acorn_loose.js 41KB
output.js 39KB
source-map-consumer.js 39KB
source-map-consumer.js 37KB
pool.js 37KB
serializer.js 36KB
topology.js 36KB
cursor.js 36KB
common.js 36KB
mongo_client.js 36KB
ast.js 34KB
sbcs-data-generated.js 31KB
replset_state.js 31KB
ast.js 31KB
server.js 31KB
_stream_readable.js 31KB
response.js 26KB
source-map.min.js 26KB
cursor.js 25KB
utils.js 25KB
expression.js 25KB
deserializer.js 24KB
expression.js 24KB
index.js 24KB
timestamp.js 24KB
code-points.js 23KB
main.js 23KB
sessions.js 23KB
uri_parser.js 23KB
scope.js 23KB
index.js 23KB
long.js 23KB
tokenize.js 22KB
tokenize.js 22KB
connect.js 22KB
lexer.js 22KB
decimal128.js 22KB
mozilla-ast.js 22KB
共 1285 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
阿齐Archie
- 粉丝: 3w+
- 资源: 2469
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 一个简单的 Universal Directx 11 Hook 来启动 ImGui.zip
- django-intro-readthedocs-io-en-latest.pdf
- AndroidAnimationDrawable帧动画的实现
- 安卓大作业 记账应用Kotlin.zip
- 基于rk3588的drm例子modeset-single-buffer
- 006-基于LED数码管的矩阵键值显示.rar
- Springboot+ChatGLM 实战AI数字人面试官系统完结14章
- Few-Shot Learning with Representative Global Prototype
- 005-基于LED数码管的数码秒表.rar
- 一个简单、直接、超薄的 CLR 库,用于高性能 Win32 Native Interop.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功