Initial
This commit is contained in:
21
node_modules/@putout/minify/LICENSE
generated
vendored
Normal file
21
node_modules/@putout/minify/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) coderaiser
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
114
node_modules/@putout/minify/README.md
generated
vendored
Normal file
114
node_modules/@putout/minify/README.md
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
# @putout/minify [![NPM version][NPMIMGURL]][NPMURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
|
||||
|
||||
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/minify.svg?style=flat&longCache=true
|
||||
[NPMURL]: https://npmjs.org/package/@putout/minify "npm"
|
||||
[CoverageURL]: https://coveralls.io/github/putoutjs/minify?branch=master
|
||||
[CoverageIMGURL]: https://coveralls.io/repos/putoutjs/minify/badge.svg?branch=master&service=github
|
||||
|
||||
🐊[**Putout**](https://github.com/coderaiser/putout)-based JavaScript minifier.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm i @putout/minify
|
||||
```
|
||||
|
||||
## Supported minifier transforms
|
||||
|
||||
Here is list of supported 🐊**Putout** transformations:
|
||||
|
||||
- ✅ [`apply-template-literals`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-apply-template-literals#readme);
|
||||
- ✅ [`apply-optional-chaining`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-apply-optional-chaining#readme);
|
||||
- ✅ [`conditions`](https://github.com/coderaiser/putout/tree/v29.10.0/packages/plugin-conditions#readme);
|
||||
- ✅ [`convert-to-arrow-function`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-convert-to-arrow-functions#readme);
|
||||
- ✅ [`convert-arguments-to-rest`](https://github.com/coderaiser/putout/tree/v29.10.1/packages/plugin-convert-arguments-to-rest#readme);
|
||||
- ✅ [`declare`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-declare#readme);
|
||||
- ✅ [`extract-sequence-expressions`](https://github.com/coderaiser/putout/tree/v34.0.0/packages/plugin-extract-sequence-expressions#readme);
|
||||
- ✅ [`for-of`](https://github.com/coderaiser/putout/tree/v34.0.0/packages/plugin-for-of#readme);
|
||||
- ✅ [`logical-expressions`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-logical-expressions#readme);
|
||||
- ✅ [`merge-duplicate-functions`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-merge-duplicate-functions#readme);
|
||||
- ✅ [`merge-duplicate-imports`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-merge-duplicate-imports#readme);
|
||||
- ✅ [`merge-destructuring-properties`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-merge-destructuring-properties#readme);
|
||||
- ✅ [`minify`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-minify#readme);
|
||||
- ✅ [`new`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-new#readme);
|
||||
- ✅ [`regexp`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-regexp#readme);
|
||||
- ✅ [`reuse-duplicate-init`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-reuse-duplicate-init#readme);
|
||||
- ✅ [`remove-empty`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-empty#readme);
|
||||
- ✅ [`remove-nested-blocks`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-nested-blocks#readme);
|
||||
- ✅ [`remove-unused-variables`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unused-variables#readme);
|
||||
- ✅ [`remove-unused-expressions`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unused-expressions#readme);
|
||||
- ✅ [`remove-unreferenced-variables`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unreferenced-variables#readme);
|
||||
- ✅ [`remove-useless-arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#readme);
|
||||
- ✅ [`remove-useless-else`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-else#readme);
|
||||
- ✅ [`remove-useless-return`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-useless-return#readme);
|
||||
- ✅ [`remove-useless-spread`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-useless-spread/#readme);
|
||||
- ✅ [`remove-useless-variables`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-useless-variables#readme);
|
||||
- ✅ [`remove-console`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-console#readme);
|
||||
- ✅ [`remove-debugger`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-debugger#readme);
|
||||
- ✅ [`remove-unreachable-code`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unreachable-code#readme);
|
||||
- ✅ [`simplify-ternary`](https://github.com/coderaiser/putout/tree/v34.0.0/packages/plugin-simplify-ternary#readme);
|
||||
- ✅ [`types`](https://github.com/coderaiser/putout/tree/v29.7.1/packages/plugin-types#readme);
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
import {minify} from '@putout/minify';
|
||||
|
||||
minify(`
|
||||
const a = 5;
|
||||
const b = 6;
|
||||
|
||||
fn(a, b);
|
||||
`);
|
||||
```
|
||||
|
||||
```
|
||||
// returns
|
||||
var a=5,b=6;fn(a,b);
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
You can also pass options to `minify`. Here is list of default options:
|
||||
|
||||
```js
|
||||
({
|
||||
mangleClassNames: true,
|
||||
mangle: true,
|
||||
removeUnusedVariables: true,
|
||||
removeConsole: false,
|
||||
removeUselessSpread: true,
|
||||
applyTemplateLiterals: true,
|
||||
});
|
||||
```
|
||||
|
||||
And usage example:
|
||||
|
||||
```js
|
||||
import {minify} from '@putout/minify';
|
||||
|
||||
const source = `
|
||||
const a = 5;
|
||||
const b = 6;
|
||||
`;
|
||||
|
||||
minify(source, {
|
||||
removeUnusedVariables: true,
|
||||
});
|
||||
```
|
||||
|
||||
### How it's compared to [Terser](https://github.com/terser/terser)?
|
||||
|
||||
For [such code](https://github.com/coderaiser/minify/issues/96#issuecomment-1546605157):
|
||||
|
||||
- 🔥 `@putout/minify`: `473B`
|
||||
- ❌ `terser`: `482B`
|
||||
|
||||
`react.js`:
|
||||
|
||||
- 🔥 `@putout/minify`: `16309B`
|
||||
- ❌ `terser`: `16346B`
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
1
node_modules/@putout/minify/bundle/minify.min.js
generated
vendored
Normal file
1
node_modules/@putout/minify/bundle/minify.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
112
node_modules/@putout/minify/package.json
generated
vendored
Normal file
112
node_modules/@putout/minify/package.json
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"name": "@putout/minify",
|
||||
"version": "3.8.5",
|
||||
"type": "module",
|
||||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
||||
"description": "🐊Putout-based minifier",
|
||||
"homepage": "https://github.com/putoutjs/minify#readme",
|
||||
"files": [
|
||||
"bundle/minify.min.js",
|
||||
"README.md"
|
||||
],
|
||||
"exports": {
|
||||
".": "./bundle/minify.min.js",
|
||||
"./dev": "./lib/minify.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/putoutjs/minify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"wisdom": "madrun wisdom",
|
||||
"test": "madrun test",
|
||||
"watch:test": "madrun watch:test",
|
||||
"lint": "madrun lint",
|
||||
"fresh:lint": "madrun fresh:lint",
|
||||
"lint:fresh": "madrun lint:fresh",
|
||||
"fix:lint": "madrun fix:lint",
|
||||
"coverage": "madrun coverage",
|
||||
"coverage:html": "madrun coverage:html",
|
||||
"report": "madrun report",
|
||||
"build": "madrun build",
|
||||
"minify": "madrun minify"
|
||||
},
|
||||
"dependencies": {},
|
||||
"keywords": [
|
||||
"putout",
|
||||
"minify",
|
||||
"AST",
|
||||
"babel",
|
||||
"printer",
|
||||
"api",
|
||||
"traverse",
|
||||
"generate"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@putout/plugin-apply-optional-chaining": "^5.0.1",
|
||||
"@putout/plugin-apply-shorthand-properties": "^5.1.0",
|
||||
"@putout/plugin-apply-template-literals": "^3.0.0",
|
||||
"@putout/plugin-conditions": "^4.0.1",
|
||||
"@putout/plugin-convert-arguments-to-rest": "^2.0.0",
|
||||
"@putout/plugin-convert-to-arrow-function": "^4.0.0",
|
||||
"@putout/plugin-declare": "^3.0.0",
|
||||
"@putout/plugin-extract-sequence-expressions": "^3.5.0",
|
||||
"@putout/plugin-for-of": "^4.0.0",
|
||||
"@putout/plugin-logical-expressions": "^5.0.0",
|
||||
"@putout/plugin-merge-destructuring-properties": "^8.0.0",
|
||||
"@putout/plugin-merge-duplicate-functions": "^2.0.0",
|
||||
"@putout/plugin-merge-duplicate-imports": "^11.0.0",
|
||||
"@putout/plugin-minify": "^8.2.0",
|
||||
"@putout/plugin-new": "^3.0.1",
|
||||
"@putout/plugin-promises": "^14.0.0",
|
||||
"@putout/plugin-regexp": "^8.0.0",
|
||||
"@putout/plugin-remove-console": "^6.0.0",
|
||||
"@putout/plugin-remove-debugger": "^6.0.0",
|
||||
"@putout/plugin-remove-empty": "^11.0.0",
|
||||
"@putout/plugin-remove-nested-blocks": "^6.3.0",
|
||||
"@putout/plugin-remove-unreachable-code": "^1.2.0",
|
||||
"@putout/plugin-remove-unreferenced-variables": "^3.0.0",
|
||||
"@putout/plugin-remove-unused-expressions": "^8.0.0",
|
||||
"@putout/plugin-remove-unused-variables": "^8.1.0",
|
||||
"@putout/plugin-remove-useless-arguments": "^8.0.0",
|
||||
"@putout/plugin-remove-useless-else": "^2.0.0",
|
||||
"@putout/plugin-remove-useless-return": "^6.0.0",
|
||||
"@putout/plugin-remove-useless-spread": "^10.0.1",
|
||||
"@putout/plugin-remove-useless-variables": "^10.0.0",
|
||||
"@putout/plugin-reuse-duplicate-init": "^5.0.0",
|
||||
"@putout/plugin-simplify-ternary": "^7.0.0",
|
||||
"@putout/plugin-types": "^3.0.0",
|
||||
"@putout/printer": "^8.8.0",
|
||||
"@rollup/plugin-alias": "^5.0.0",
|
||||
"@rollup/plugin-commonjs": "^25.0.1",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.2",
|
||||
"c8": "^9.0.0",
|
||||
"eslint": "^8.0.1",
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-plugin-putout": "^22.2.1",
|
||||
"fullstore": "^3.0.0",
|
||||
"just-kebab-case": "^4.2.0",
|
||||
"just-snake-case": "^3.2.0",
|
||||
"madrun": "^10.0.0",
|
||||
"minify": "^11.1.0",
|
||||
"mock-require": "^3.0.3",
|
||||
"montag": "^1.0.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"putout": "^35.0.0",
|
||||
"rendy": "^4.1.3",
|
||||
"rollup": "^4.5.0",
|
||||
"rollup-plugin-node-externals": "^7.0.1",
|
||||
"rollup-plugin-polyfill-node": "^0.13.0",
|
||||
"supertape": "^10.0.0",
|
||||
"try-catch": "^3.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user