clear
This commit is contained in:
99
node_modules/gulp-uglify/CHANGELOG.md
generated
vendored
Normal file
99
node_modules/gulp-uglify/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="1.5.4"></a>
|
||||
## [1.5.4](https://github.com/terinjokes/gulp-uglify/compare/v1.5.3...v1.5.4) (2016-06-22)
|
||||
|
||||
|
||||
|
||||
# gulp-uglify changelog
|
||||
|
||||
## 1.5.3
|
||||
|
||||
- Updated UglifyJS to 2.6.2
|
||||
|
||||
## 1.5.2
|
||||
|
||||
- Updated UglfiyJS to 2.6.1
|
||||
|
||||
## 1.5.0
|
||||
|
||||
- Update UglifyJS to 2.6.0.
|
||||
- CI and dependencies chores.
|
||||
- Attempt to resolve issue #109 where "ghost" files would appear in generated sourcemaps.
|
||||
|
||||
## 1.4.2
|
||||
|
||||
- Updated UglifyJS to 2.5.0.
|
||||
- CI and dependencies chores.
|
||||
|
||||
## 1.4.1
|
||||
|
||||
- Detect if options is a non-Object and log a warning.
|
||||
|
||||
Older versions of Node.js did not allow Strings to be passed to `Object.keys` leading to errors and confusion to users following certain tutorials.
|
||||
|
||||
## 1.4.0
|
||||
|
||||
- Deprecated the `preserveComments` option of "some".
|
||||
- Added the `preserveComments` option of "license" that uses [`uglify-save-license`](https://github.com/shinnn/uglify-save-license).
|
||||
|
||||
## 1.3.0
|
||||
|
||||
- Updated UglifyJS to 2.4.24.
|
||||
- Streams3 support via through2 dependency update.
|
||||
|
||||
## 1.2.0
|
||||
|
||||
- Update dependencies, including UglifyJS to 2.4.19.
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- Fix sources path in source maps (thanks @floridoo)
|
||||
- Update UglifyJS to 2.4.16 (thanks @tschaub)
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Handle cases where UglifyJS uses e.msg instead of e.message for error codes. Fixes #51.
|
||||
- Supplement UglifyJS’s source map merging with vinyl-sourcemap-apply to correct issues where `sources` and `sourcesContent` were different. Fixes #43.
|
||||
- Refactor option parsing and defaults, and calls to uglify-js, to reduce complexity of the main function.
|
||||
- Added tests for the previously forgotten `preserveComments` option.
|
||||
- Updated UglifyJS to 2.4.15.
|
||||
- Changed dependencies to explicit ranges to avoid `node-semver` issues.
|
||||
|
||||
## 0.3.2
|
||||
|
||||
- Removed the PluginError factory wrapper
|
||||
- Removed test that was failing due to gulp-util issue.
|
||||
- Tests should end the streams they are writing to.
|
||||
- Update dependencies. Fixes #44. Fixes #42.
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- Fixed homepage URL in npm metadata
|
||||
- Removes UglifyJS-inserted sourceMappingURL comment [Fixes #39]
|
||||
- Don’t pass input source map to UglifyJS if there are no mappings
|
||||
- Added installation instructions
|
||||
|
||||
## 0.3.0
|
||||
|
||||
- Removed support for old style source maps
|
||||
- Added support for gulp-sourcemap
|
||||
- Updated tape development dependency
|
||||
- Dropped support for Node 0.9
|
||||
- UglifyJS errors are no longer swallowed
|
||||
|
||||
## 0.2.1
|
||||
|
||||
- Correct source map output
|
||||
- Remove `gulp` dependency by using `vinyl` in testing
|
||||
- Passthrough null files correctly
|
||||
- Report error if attempting to use a stream-backed file
|
||||
|
||||
## 0.2.0
|
||||
|
||||
- Dropped support for Node versions less than 0.9
|
||||
- Switched to using Streams2
|
||||
- Add support for generating source maps
|
||||
- Add option for preserving comments
|
||||
20
node_modules/gulp-uglify/LICENSE.md
generated
vendored
Normal file
20
node_modules/gulp-uglify/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
> Copyright (c) 2013-2014 Terin Stock <terinjokes@gmail.com>
|
||||
>
|
||||
> 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.
|
||||
133
node_modules/gulp-uglify/README.md
generated
vendored
Normal file
133
node_modules/gulp-uglify/README.md
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
# gulp-uglify [![][travis-shield-img]][travis-shield][![][appveyor-shield-img]][appveyor-shield][![][npm-dl-shield-img]][npm-shield][![][npm-v-shield-img]][npm-shield][![][coveralls-shield-img]][coveralls-shield]
|
||||
|
||||
> Minify JavaScript with UglifyJS2.
|
||||
|
||||
## Installation
|
||||
|
||||
Install package with NPM and add it to your development dependencies:
|
||||
|
||||
`npm install --save-dev gulp-uglify`
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var uglify = require('gulp-uglify');
|
||||
var pump = require('pump');
|
||||
|
||||
gulp.task('compress', function (cb) {
|
||||
pump([
|
||||
gulp.src('lib/*.js'),
|
||||
uglify(),
|
||||
gulp.dest('dist')
|
||||
],
|
||||
cb
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
To help properly handle error conditions with Node streams, this project
|
||||
recommends the use of [`pump`](https://github.com/mafintosh/pump). For more
|
||||
information, see [Why Use Pump?](docs/why-use-pump/README.md#why-use-pump).
|
||||
|
||||
## Options
|
||||
|
||||
- `mangle`
|
||||
|
||||
Pass `false` to skip mangling names.
|
||||
|
||||
- `output`
|
||||
|
||||
Pass an object if you wish to specify additional [output
|
||||
options](http://lisperator.net/uglifyjs/codegen). The defaults are
|
||||
optimized for best compression.
|
||||
|
||||
- `compress`
|
||||
|
||||
Pass an object to specify custom [compressor
|
||||
options](http://lisperator.net/uglifyjs/compress). Pass `false` to skip
|
||||
compression completely.
|
||||
|
||||
- `preserveComments`
|
||||
|
||||
A convenience option for `options.output.comments`. Defaults to preserving no
|
||||
comments.
|
||||
|
||||
- `all`
|
||||
|
||||
Preserve all comments in code blocks
|
||||
|
||||
- `license`
|
||||
|
||||
Attempts to preserve comments that likely contain licensing information,
|
||||
even if the comment does not have directives such as `@license` or `/*!`.
|
||||
|
||||
Implemented via the [`uglify-save-license`](https://github.com/shinnn/uglify-save-license)
|
||||
module, this option preserves a comment if one of the following is true:
|
||||
|
||||
1. The comment is in the *first* line of a file
|
||||
2. A regular expression matches the string of the comment.
|
||||
For example: `MIT`, `@license`, or `Copyright`.
|
||||
3. There is a comment at the *previous* line, and it matches 1, 2, or 3.
|
||||
|
||||
- `function`
|
||||
|
||||
Specify your own comment preservation function. You will be passed the
|
||||
current node and the current comment and are expected to return either
|
||||
`true` or `false`.
|
||||
|
||||
- `some` (deprecated)
|
||||
|
||||
Preserve comments that start with a bang (`!`) or include a Closure Compiler
|
||||
directive (`@preserve`, `@license`, `@cc_on`).
|
||||
Deprecated in favor of the `license` option, documented above.
|
||||
|
||||
You can also pass the `uglify` function any of the options [listed
|
||||
here](https://github.com/mishoo/UglifyJS2#the-simple-way) to modify
|
||||
UglifyJS's behavior.
|
||||
|
||||
## Errors
|
||||
|
||||
`gulp-uglify` emits an 'error' event if it is unable to minify a specific file.
|
||||
Wherever possible, the PluginError object will contain the following properties:
|
||||
|
||||
- `fileName`
|
||||
- `lineNumber`
|
||||
- `message`
|
||||
|
||||
## Using a Different UglifyJS
|
||||
|
||||
By default, `gulp-uglify` uses the version of UglifyJS installed as a dependency.
|
||||
It's possible to configure the use of a different version using the "minifier" entry point.
|
||||
|
||||
```javascript
|
||||
var uglifyjs = require('uglify-js'); // can be a git checkout
|
||||
// or another module (such as `uglify-js-harmony` for ES6 support)
|
||||
var minifer = require('gulp-uglify/minifier');
|
||||
var pump = require('pump');
|
||||
|
||||
gulp.task('compress', function (cb) {
|
||||
// the same options as described above
|
||||
var options = {
|
||||
preserveComments: 'license'
|
||||
};
|
||||
|
||||
pump([
|
||||
gulp.src('lib/*.js'),
|
||||
minifier(options, uglifyjs),
|
||||
gulp.dest('dist')
|
||||
],
|
||||
cb
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
[travis-shield-img]: https://img.shields.io/travis/terinjokes/gulp-uglify/master.svg?label=Travis%20CI&style=flat-square
|
||||
[travis-shield]: https://travis-ci.org/terinjokes/gulp-uglify
|
||||
[appveyor-shield-img]: https://img.shields.io/appveyor/ci/terinjokes/gulp-uglify/master.svg?label=AppVeyor&style=flat-square
|
||||
[appveyor-shield]: https://ci.appveyor.com/project/terinjokes/gulp-uglify
|
||||
[npm-dl-shield-img]: https://img.shields.io/npm/dm/gulp-uglify.svg?style=flat-square
|
||||
[npm-shield]: http://browsenpm.org/package/gulp-uglify
|
||||
[npm-v-shield-img]: https://img.shields.io/npm/v/gulp-uglify.svg?style=flat-square
|
||||
[coveralls-shield-img]: https://img.shields.io/coveralls/terinjokes/gulp-uglify/master.svg?style=flat-square
|
||||
[coveralls-shield]: https://coveralls.io/github/terinjokes/gulp-uglify
|
||||
7
node_modules/gulp-uglify/index.js
generated
vendored
Normal file
7
node_modules/gulp-uglify/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
var uglify = require('uglify-js');
|
||||
var minifier = require('./minifier');
|
||||
|
||||
module.exports = function (opts) {
|
||||
return minifier(opts, uglify);
|
||||
};
|
||||
22
node_modules/gulp-uglify/lib/create-error.js
generated
vendored
Normal file
22
node_modules/gulp-uglify/lib/create-error.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
var PluginError = require('gulp-util/lib/PluginError');
|
||||
|
||||
var pluginName = 'gulp-uglify';
|
||||
|
||||
module.exports = function createError(file, err) {
|
||||
if (typeof err === 'string') {
|
||||
return new PluginError(pluginName, file.path + ': ' + err, {
|
||||
fileName: file.path,
|
||||
showStack: false
|
||||
});
|
||||
}
|
||||
|
||||
var msg = err.message || err.msg || 'unspecified error';
|
||||
|
||||
return new PluginError(pluginName, file.path + ': ' + msg, {
|
||||
fileName: file.path,
|
||||
lineNumber: err.line,
|
||||
stack: err.stack,
|
||||
showStack: false
|
||||
});
|
||||
};
|
||||
87
node_modules/gulp-uglify/minifier.js
generated
vendored
Normal file
87
node_modules/gulp-uglify/minifier.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
'use strict';
|
||||
var through = require('through2');
|
||||
var deap = require('deap');
|
||||
var PluginError = require('gulp-util/lib/PluginError');
|
||||
var log = require('fancy-log');
|
||||
var applySourceMap = require('vinyl-sourcemaps-apply');
|
||||
var saveLicense = require('uglify-save-license');
|
||||
var isObject = require('isobject');
|
||||
var createError = require('./lib/create-error');
|
||||
|
||||
var reSourceMapComment = /\n\/\/# sourceMappingURL=.+?$/;
|
||||
|
||||
function trycatch(fn, handle) {
|
||||
try {
|
||||
return fn();
|
||||
} catch (err) {
|
||||
return handle(err);
|
||||
}
|
||||
}
|
||||
|
||||
function setup(opts) {
|
||||
if (opts && !isObject(opts)) {
|
||||
log('gulp-uglify expects an object, non-object provided');
|
||||
opts = {};
|
||||
}
|
||||
|
||||
var options = deap({}, opts, {
|
||||
fromString: true,
|
||||
output: {}
|
||||
});
|
||||
|
||||
if (options.preserveComments === 'all') {
|
||||
options.output.comments = true;
|
||||
} else if (options.preserveComments === 'some') {
|
||||
// preserve comments with directives or that start with a bang (!)
|
||||
options.output.comments = /^!|@preserve|@license|@cc_on/i;
|
||||
} else if (options.preserveComments === 'license') {
|
||||
options.output.comments = saveLicense;
|
||||
} else if (typeof options.preserveComments === 'function') {
|
||||
options.output.comments = options.preserveComments;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
module.exports = function (opts, uglify) {
|
||||
function minify(file, encoding, callback) {
|
||||
var options = setup(opts || {});
|
||||
|
||||
if (file.isNull()) {
|
||||
return callback(null, file);
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
return callback(createError(file, 'Streaming not supported'));
|
||||
}
|
||||
|
||||
if (file.sourceMap) {
|
||||
options.outSourceMap = file.relative;
|
||||
}
|
||||
|
||||
var originalContents = String(file.contents);
|
||||
|
||||
var mangled = trycatch(function () {
|
||||
var m = uglify.minify(String(file.contents), options);
|
||||
m.code = new Buffer(m.code.replace(reSourceMapComment, ''));
|
||||
return m;
|
||||
}, createError.bind(null, file));
|
||||
|
||||
if (mangled instanceof PluginError) {
|
||||
return callback(mangled);
|
||||
}
|
||||
|
||||
file.contents = mangled.code;
|
||||
|
||||
if (file.sourceMap) {
|
||||
var sourceMap = JSON.parse(mangled.map);
|
||||
sourceMap.sources = [file.relative];
|
||||
sourceMap.sourcesContent = [originalContents];
|
||||
applySourceMap(file, sourceMap);
|
||||
}
|
||||
|
||||
callback(null, file);
|
||||
}
|
||||
|
||||
return through.obj(minify);
|
||||
};
|
||||
114
node_modules/gulp-uglify/package.json
generated
vendored
Normal file
114
node_modules/gulp-uglify/package.json
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "gulp-uglify@^1.5.4",
|
||||
"scope": null,
|
||||
"escapedName": "gulp-uglify",
|
||||
"name": "gulp-uglify",
|
||||
"rawSpec": "^1.5.4",
|
||||
"spec": ">=1.5.4 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"D:\\web\\layui\\res\\layui"
|
||||
]
|
||||
],
|
||||
"_from": "gulp-uglify@>=1.5.4 <2.0.0",
|
||||
"_id": "gulp-uglify@1.5.4",
|
||||
"_inCache": true,
|
||||
"_location": "/gulp-uglify",
|
||||
"_nodeVersion": "4.4.5",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/gulp-uglify-1.5.4.tgz_1466626831389_0.47820967994630337"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "terinjokes",
|
||||
"email": "terinjokes@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.15.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "gulp-uglify@^1.5.4",
|
||||
"scope": null,
|
||||
"escapedName": "gulp-uglify",
|
||||
"name": "gulp-uglify",
|
||||
"rawSpec": "^1.5.4",
|
||||
"spec": ">=1.5.4 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz",
|
||||
"_shasum": "524788d87666d09f9d0c21fb2177f90039a658c9",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gulp-uglify@^1.5.4",
|
||||
"_where": "D:\\web\\layui\\res\\layui",
|
||||
"author": {
|
||||
"name": "Terin Stock",
|
||||
"email": "terinjokes@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/terinjokes/gulp-uglify/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"deap": "^1.0.0",
|
||||
"fancy-log": "^1.0.0",
|
||||
"gulp-util": "^3.0.0",
|
||||
"isobject": "^2.0.0",
|
||||
"through2": "^2.0.0",
|
||||
"uglify-js": "2.6.4",
|
||||
"uglify-save-license": "^0.4.1",
|
||||
"vinyl-sourcemaps-apply": "^0.2.0"
|
||||
},
|
||||
"description": "Minify files with UglifyJS.",
|
||||
"devDependencies": {
|
||||
"cmem": "^1.0.0",
|
||||
"coveralls": "^2.11.4",
|
||||
"gulp-concat": "^2.0.0",
|
||||
"gulp-sourcemaps": "^1.0.0",
|
||||
"istanbul": "^0.4.0",
|
||||
"tape": "^4.0.0",
|
||||
"vinyl": "^1.0.0",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "524788d87666d09f9d0c21fb2177f90039a658c9",
|
||||
"tarball": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"minifier.js",
|
||||
"lib/"
|
||||
],
|
||||
"gitHead": "80da765a266cb7ff9d034a73bde0abe18d72d6de",
|
||||
"homepage": "https://github.com/terinjokes/gulp-uglify/",
|
||||
"keywords": [
|
||||
"gulpplugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "terinjokes",
|
||||
"email": "terinjokes@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "gulp-uglify",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/terinjokes/gulp-uglify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "cat ./coverage/lcov.info | coveralls",
|
||||
"test": "xo && istanbul cover ./node_modules/tape/bin/tape test/*.js"
|
||||
},
|
||||
"version": "1.5.4",
|
||||
"xo": {
|
||||
"space": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user