Commit modules
This commit is contained in:
21
node_modules/@node-minify/babel-minify/LICENSE
generated
vendored
Normal file
21
node_modules/@node-minify/babel-minify/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Rodolphe Stoclin
|
||||
|
||||
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.
|
||||
47
node_modules/@node-minify/babel-minify/README.md
generated
vendored
Normal file
47
node_modules/@node-minify/babel-minify/README.md
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<p align="center"><img src="/static/node-minify.png" width="348" alt="node-minify"></p>
|
||||
|
||||
<p align="center">A very light minifier Node.js module.</p>
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<a href="https://npmjs.org/package/@node-minify/babel-minify"><img src="https://img.shields.io/npm/v/@node-minify/babel-minify.svg"></a>
|
||||
<a href="https://npmjs.org/package/@node-minify/babel-minify"><img src="https://img.shields.io/npm/dm/@node-minify/babel-minify.svg"></a>
|
||||
<a href="https://codecov.io/gh/srod/node-minify"><img src="https://codecov.io/gh/srod/node-minify/branch/develop/graph/badge.svg"></a><br>
|
||||
<a href="https://travis-ci.org/srod/node-minify"><img src="https://img.shields.io/travis/srod/node-minify/master.svg?label=linux"></a>
|
||||
<a href="https://dev.azure.com/srodolphe/srodolphe/_build/latest?definitionId=1"><img src="https://dev.azure.com/srodolphe/srodolphe/_apis/build/status/srod.node-minify?branchName=master"></a>
|
||||
<a href="https://circleci.com/gh/srod/node-minify/tree/master"><img src="https://circleci.com/gh/srod/node-minify/tree/master.svg?style=shield"></a>
|
||||
</p>
|
||||
|
||||
# babel-minify
|
||||
|
||||
`babel-minify` is a plugin for [`node-minify`](https://github.com/srod/node-minify)
|
||||
|
||||
It allow you to compress JavaScript files.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @node-minify/core @node-minify/babel-minify
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const minify = require('@node-minify/core');
|
||||
const babelMinify = require('@node-minify/babel-minify');
|
||||
|
||||
minify({
|
||||
compressor: babelMinify,
|
||||
input: 'foo.js',
|
||||
output: 'bar.js',
|
||||
callback: function(err, min) {}
|
||||
});
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Visit https://node-minify.2clics.net/compressors/babel-minify.html for full documentation
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/srod/node-minify/blob/develop/LICENSE)
|
||||
70
node_modules/@node-minify/babel-minify/lib/babel-minify.js
generated
vendored
Normal file
70
node_modules/@node-minify/babel-minify/lib/babel-minify.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
|
||||
var _babelCore = require("babel-core");
|
||||
|
||||
var _babelPresetMinify = _interopRequireDefault(require("babel-preset-minify"));
|
||||
|
||||
var _utils = require("@node-minify/utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/*!
|
||||
* node-minify
|
||||
* Copyright(c) 2011-2019 Rodolphe Stoclin
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Run babel-minify.
|
||||
*
|
||||
* @param {Object} settings
|
||||
* @param {String} content
|
||||
* @param {Function} callback
|
||||
*/
|
||||
const minifyBabel = ({
|
||||
settings,
|
||||
content,
|
||||
callback,
|
||||
index
|
||||
}) => {
|
||||
let babelOptions = {
|
||||
presets: []
|
||||
};
|
||||
|
||||
if (settings.options.babelrc) {
|
||||
babelOptions = JSON.parse(_utils.utils.readFile(settings.options.babelrc));
|
||||
}
|
||||
|
||||
if (settings.options.presets) {
|
||||
const babelrcPresets = babelOptions.presets || [];
|
||||
babelOptions.presets = babelrcPresets.concat(settings.options.presets);
|
||||
}
|
||||
|
||||
if (babelOptions.presets.indexOf('minify') === -1) {
|
||||
babelOptions.presets = babelOptions.presets.concat([_babelPresetMinify.default]);
|
||||
}
|
||||
|
||||
const contentMinified = (0, _babelCore.transform)(content, babelOptions);
|
||||
|
||||
_utils.utils.writeFile({
|
||||
file: settings.output,
|
||||
content: contentMinified.code,
|
||||
index
|
||||
});
|
||||
|
||||
if (callback) {
|
||||
return callback(null, contentMinified.code);
|
||||
}
|
||||
|
||||
return contentMinified.code;
|
||||
};
|
||||
/**
|
||||
* Expose `minifyBabel()`.
|
||||
*/
|
||||
|
||||
|
||||
module.exports = minifyBabel;
|
||||
74
node_modules/@node-minify/babel-minify/package.json
generated
vendored
Normal file
74
node_modules/@node-minify/babel-minify/package.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@node-minify/babel-minify@4.1.2",
|
||||
"C:\\EndBug\\GitHub\\add-and-commit"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@node-minify/babel-minify@4.1.2",
|
||||
"_id": "@node-minify/babel-minify@4.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-7oI6t7Hv3RY955RxmiZ3QGzDxYKEJAW5Kd6Otu3yKFB0B84aWzGFqstgwQRnqeeEHSybSqX6bepUmvxseKk9uQ==",
|
||||
"_location": "/@node-minify/babel-minify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@node-minify/babel-minify@4.1.2",
|
||||
"name": "@node-minify/babel-minify",
|
||||
"escapedName": "@node-minify%2fbabel-minify",
|
||||
"scope": "@node-minify",
|
||||
"rawSpec": "4.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@node-minify/babel-minify/-/babel-minify-4.1.2.tgz",
|
||||
"_spec": "4.1.2",
|
||||
"_where": "C:\\EndBug\\GitHub\\add-and-commit",
|
||||
"author": {
|
||||
"name": "Rodolphe Stoclin",
|
||||
"email": "srodolphe@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/srod/node-minify/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@node-minify/utils": "^4.1.2",
|
||||
"babel-core": "6.26.3",
|
||||
"babel-preset-minify": "0.5.0"
|
||||
},
|
||||
"description": "babel-minify plugin for @node-minify",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"gitHead": "b13f16dfcac6f151c371414cf3a8a2969ff08783",
|
||||
"homepage": "https://github.com/srod/node-minify/tree/master/packages/babel-minify#readme",
|
||||
"keywords": [
|
||||
"compressor",
|
||||
"minify",
|
||||
"minifier",
|
||||
"babel-minify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/babel-minify.js",
|
||||
"name": "@node-minify/babel-minify",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/srod/node-minify.git"
|
||||
},
|
||||
"version": "4.1.2"
|
||||
}
|
||||
Reference in New Issue
Block a user