<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]
[![CI pipeline][ci-image]][ci-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
[ci-image]: https://github.com/terser/terser/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/terser/terser/actions/workflows/ci.yml
[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.
`only_annotated` Only mangle properties defined with /*@__MANGLE_PROP__*/.
`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
没有合适的资源?快使用搜索试试~ 我知道了~
Vue-组件高级(下)商品列表案例
共2000个文件
js:1610个
ts:518个
md:436个
0 下载量 61 浏览量
2023-07-22
21:31:56
上传
评论
收藏 13.68MB RAR 举报
温馨提示
ref、$nextTick、keep-alive、插槽、自定义指令
资源推荐
资源详情
资源评论
收起资源包目录
Vue-组件高级(下)商品列表案例 (2000个子文件)
bootstrap.css 143KB
bootstrap.min.css 119KB
bootstrap-theme.css 25KB
bootstrap-theme.min.css 23KB
urls.css 5KB
urls.css 2KB
urls.css 2KB
urls.css 1KB
urls.css 1KB
urls.css 1KB
simple.css 99B
plugin.css 77B
index.css 58B
postProcessor.css 44B
foo.css 28B
simple.css 24B
tomcat_charset.html 18KB
props.html 1KB
index.html 600B
index.html 313B
tslib.es6.html 36B
tslib.html 32B
compiler-sfc.esm-browser.js 1.46MB
bundle.min.js 962KB
rollup.js 875KB
rollup.js 873KB
compiler-sfc.cjs.js 611KB
index.js 480KB
less.js 476KB
vue.global.js 463KB
vue.esm-browser.js 435KB
rollup.browser.js 388KB
rollup.browser.js 387KB
vue.runtime.global.js 321KB
runtime-dom.global.js 320KB
vue.js 314KB
forge.all.min.js 302KB
vue.runtime.esm-browser.js 297KB
runtime-dom.esm-browser.js 297KB
forge.min.js 281KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
source-map.debug.js 266KB
runtime-core.esm-bundler.js 230KB
acorn.js 225KB
runtime-core.cjs.js 224KB
server-renderer.esm-browser.js 216KB
runtime-core.cjs.prod.js 174KB
compiler-dom.global.js 168KB
domprops.js 166KB
compiler-core.cjs.js 160KB
compiler-core.cjs.prod.js 155KB
compiler-dom.esm-browser.js 154KB
less.min.js 143KB
compiler-core.esm-bundler.js 139KB
index.js 137KB
watch.js 135KB
vue.esm-browser.prod.js 131KB
tls.js 130KB
vue.global.prod.js 128KB
parse.js 123KB
index.js 118KB
pluginutils.cjs.js 109KB
pluginutils.es.js 109KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
source-map.js 104KB
x509.js 103KB
ast.js 96KB
index.js 93KB
parser.js 93KB
index.js 84KB
vue.runtime.esm-browser.prod.js 84KB
runtime-dom.esm-browser.prod.js 84KB
vue.runtime.global.prod.js 83KB
runtime-dom.global.prod.js 83KB
output.js 79KB
util.js 75KB
statement.js 71KB
resolveSeq-492ab440.js 69KB
compiler-dom.cjs.js 65KB
compiler-dom.cjs.prod.js 63KB
container.js 63KB
container.js 63KB
expression.js 61KB
mozilla-ast.js 60KB
resolveSeq-d03cb037.js 59KB
server-renderer.esm-browser.prod.js 58KB
tighten-body.js 58KB
compiler-dom.esm-browser.prod.js 57KB
compiler-dom.global.prod.js 57KB
rsa.js 56KB
parser.js 55KB
parser.js 55KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
再学习一点
- 粉丝: 48
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- #P0015. 全排列 超级简单
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功