<h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1>
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Travis Build][travis-image]][travis-url]
[![Opencollective financial contributors][opencollective-contributors]][opencollective-url]
A JavaScript mangler/compressor toolkit for ES6+.
*note*: <s>You can support this project on patreon: [link]</s> **The Terser Patreon is shutting down in favor of opencollective**. Check out [PATRONS.md](https://github.com/terser/terser/blob/master/PATRONS.md) for our first-tier patrons.
Terser recommends you use RollupJS to bundle your modules, as that produces smaller code overall.
*Beautification* has been undocumented and is *being removed* from terser, we recommend you use [prettier](https://npmjs.com/package/prettier).
Find the changelog in [CHANGELOG.md](https://github.com/terser/terser/blob/master/CHANGELOG.md)
[npm-image]: https://img.shields.io/npm/v/terser.svg
[npm-url]: https://npmjs.org/package/terser
[downloads-image]: https://img.shields.io/npm/dm/terser.svg
[downloads-url]: https://npmjs.org/package/terser
[travis-image]: https://app.travis-ci.com/terser/terser.svg?branch=master
[travis-url]: https://app.travis-ci.com/github/terser/terser
[opencollective-contributors]: https://opencollective.com/terser/tiers/badge.svg
[opencollective-url]: https://opencollective.com/terser
Why choose terser?
------------------
`uglify-es` is [no longer maintained](https://github.com/mishoo/UglifyJS2/issues/3156#issuecomment-392943058) and `uglify-js` does not support ES6+.
**`terser`** is a fork of `uglify-es` that mostly retains API and CLI compatibility
with `uglify-es` and `uglify-js@3`.
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 terser -g
From NPM for programmatic use:
npm install terser
# Command line usage
<!-- CLI_USAGE:START -->
terser [input files] [options]
Terser can take multiple input files. It's recommended that you pass the
input files first, then pass the options. Terser 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.
Command line arguments that take options (like --parse, --compress, --mangle and
--format) can take in a comma-separated list of default option overrides. For
instance:
terser input.js --compress ecma=2015,computed_props=false
If no input file is specified, Terser 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:
terser --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 and DOM
API props.
`debug` Add debug prefix and suffix.
`keep_quoted` Only mangle unquoted properties, quoted
properties are automatically reserved.
`strict` disables quoted properties
being automatically reserved.
`regex` Only mangle matched property names.
`reserved` List of names that should not be mangled.
-f, --format [options] Specify format options.
`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.
`wrap_func_args` Wrap function arguments in parenthesis.
-o, --output <file> Output file path (default STDOUT). Specify `ast` or
`spidermonkey` to write Terser 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 e.g. "@license",
or start with "!". You can optionally pass one of the
following arguments to this flag:
- "all" to keep all comments
- `false` to omit comments in the output
- 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, 2015, 2016, etc.
-e, --enclose [arg[:value]] Embed output in a big function with configurable
arguments and values.
--ie8 Support non-standard Internet Explorer 8
没有合适的资源?快使用搜索试试~ 我知道了~
vue自定义指令合集 vue2.0版本
共3977个文件
js:3391个
ts:274个
json:72个
需积分: 0 0 下载量 199 浏览量
2022-12-17
19:52:42
上传
评论
收藏 12.2MB RAR 举报
温馨提示
vue自定义指令合集。vue2.0版本
资源推荐
资源详情
资源评论
收起资源包目录
vue自定义指令合集 vue2.0版本 (3977个子文件)
acorn 316B
acorn 60B
openChrome.applescript 3KB
system-node.cjs 508KB
publicUtils.cjs 112KB
index.cjs 91KB
index.cjs 21KB
index.cjs 1KB
nanoid.cjs 1KB
index.browser.cjs 1KB
index.cjs 1016B
index.cjs 993B
index.browser.cjs 983B
index.cjs 499B
exit.cjs 249B
index.cjs 120B
index.cjs 111B
parser.cmd 293B
rollup.cmd 282B
nanoid.cmd 281B
esbuild.cmd 279B
resolve.cmd 279B
terser.cmd 277B
vite.cmd 276B
acorn.cmd 275B
cup.coffee 1B
mug.coffee 0B
base.css 2KB
main.css 477B
.editorconfig 605B
.editorconfig 286B
esbuild 8KB
esbuild 758B
esbuild 324B
.eslintrc 2KB
.eslintrc 339B
.eslintrc 231B
.eslintrc 176B
.eslintrc 132B
esbuild.exe 8.35MB
index.js.flow 307KB
.gitignore 291B
.gitkeep 0B
.gitkeep 0B
props.html 1KB
index.html 337B
favicon.ico 4KB
vue-project.iml 344B
babel.js 4.6MB
babel.min.js 2.64MB
dep-5605cfa4.js 1.99MB
bundle.min.js 942KB
rollup.js 875KB
rollup.js 873KB
compiler-sfc.js 643KB
compiler-sfc.js 643KB
index.js 474KB
vue.js 424KB
vue.esm.js 408KB
vue.common.dev.js 389KB
rollup.browser.js 388KB
vue.esm.browser.js 388KB
rollup.browser.js 387KB
dep-19c40c50.js 328KB
vue.runtime.js 308KB
vue.runtime.esm.js 297KB
vue.runtime.common.dev.js 283KB
source-map.debug.js 266KB
dep-4d50f047.js 220KB
acorn.js 213KB
vue.js 203KB
domprops.js 166KB
index.js 136KB
watch.js 135KB
parse.js 121KB
index.js 118KB
vue.min.js 105KB
source-map.js 104KB
vue.esm.browser.min.js 102KB
vue.common.prod.js 101KB
ast.js 92KB
main.js 81KB
output.js 77KB
vue.runtime.min.js 74KB
vue.runtime.common.prod.js 73KB
tighten-body.js 57KB
mozilla-ast.js 57KB
browser-source-map-support.js 52KB
source-map-consumer.js 41KB
source-map-consumer.js 40KB
magic-string.umd.js 36KB
inference.js 36KB
source-map.umd.js 36KB
web.url.constructor.js 35KB
scope.js 35KB
system.js 35KB
magic-string.cjs.js 33KB
index.js 27KB
source-map.min.js 26KB
cli.js 26KB
共 3977 条
- 1
- 2
- 3
- 4
- 5
- 6
- 40
资源评论
Dormiveglia-flx
- 粉丝: 340
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功