{ "name": "gulp-uglifyjs", "description": "Minify multiple files with UglifyJS.", "version": "0.6.2", "author": { "name": "Craig Jennings", "email": "craig.jennings@gmail.com" }, "dependencies": { "gulp-util": "^3.0.4", "through": "^2.3.4", "uglify-js": "^2.4.13" }, "devDependencies": { "chai": "^2.3.0", "mocha": "^2.2.4" }, "keywords": [ "gulp", "gulp-uglify", "gulp-uglifyjs", "gulpplugin", "uglify", "uglify-js", "uglifyjs" ], "license": "MIT", "main": "index.js", "repository": { "type": "git", "url": "https://github.com/craigjennings11/gulp-uglifyjs.git" }, "scripts": { "test": "mocha" }, "readme": "# gulp-uglifyjs [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n\n__DEPRECATED__: This plugin has been blacklisted as it relies on Uglify to concat\nthe files instead of using [gulp-concat][concat-link], which breaks the \"It\nshould do one thing\" paradigm. When I created this plugin, there was no way to\nget source maps to work with gulp, however now there is a [gulp-sourcemaps][sourcemaps-link]\nplugin that achieves the same goal. gulp-uglifyjs still works great and gives\nvery granular control over the Uglify execution, I'm just giving you a heads up\nthat other options now exist.\n\n> Minify multiple JavaScript with UglifyJS2.\n\nThis plugin is based off of [gulp-uglify][uglify-link] but allows you to\ndirectly use all of Uglify's options. The main difference between these two\nplugins is that passing in an array of files (or glob pattern that matches\nmultiple files) will pass that array directly to Uglify. Uglify will handle both\nconcatenating and minifying those files.\n\nLetting Uglify handle the concatenation and minification allows for the\ngenerated source map to be able to separate the files in the browser for easier\ndebugging, and it avoids the intermediate step of `concat()`. Using `concat()`\nand then `uglify()` would result in a source map for the already concatenated\nfile which has the possibility of being quite large, making it hard to find the\ncode you are wanting to debug.\n\n[sourcemaps-link]: https://github.com/floridoo/gulp-sourcemaps\n[concat-link]: https://github.com/wearefractal/gulp-concat\n[uglify-link]: https://github.com/terinjokes/gulp-uglify\n\n## Usage\n\n```javascript\nvar uglify = require('gulp-uglifyjs');\n\ngulp.task('uglify', function() {\n gulp.src('public/js/*.js')\n .pipe(uglify())\n .pipe(gulp.dest('dist/js'))\n});\n```\n\nThis will concatenate and minify all files found by `public/js/*.js` and write\nit to a file with the same name as the first file found.\n\n## API\n\n`uglify([filename], [options])`\n\n- filename - optional\n\n Override the default output filename.\n\n- options - optional\n\n These options are directly passed to Uglify. Below are some examples of what\n is available. To see a full list, read UglifyJS's [documentation](https://github.com/mishoo/UglifyJS2/#api-reference)\n\n - `outSourceMap`\n\n (default `false`) Give a `string` to be the name of the source map. Set to\n `true` and the source map name will be the same as the output file name\n suffixed with `.map`.\n\n Note: if you would like your source map to point to relative paths instead\n of absolute paths (which you probably will if it is hosted on a server), set\n the `basePath` option to be the base of where the content is served.\n\n - `inSourceMap`\n\n If you're compressing compiled JavaScript and have a source map for it, you\n can use the inSourceMap argument. This can only be used in conjunction with\n `outSourceMap`.\n\n - `sourceRoot`\n\n Sets the root location for where the source files should be found\n\n - `mangle`\n\n (default `{}`) Set to `false` to skip mangling names. See [options](https://github.com/mishoo/UglifyJS2/blob/e37b67d013c4537a36bb3c24f4f99e72efbf6d4b/lib/scope.js#L328) for possible key/value pairs.\n\n - `output`\n\n (default `null`) Pass an Object if you wish to specify additional [output options](http://lisperator.net/uglifyjs/codegen).\n The defaults are optimized for best compression.\n\n - `compress`\n\n (default `{}`) Pass an Object to specify custom [compressor options](http://lisperator.net/uglifyjs/compress).\n Pass `false` to skip compression completely.\n\n - `enclose`\n\n (default `undefined`) Pass an Object to wrap all of the code in a closure\n with a configurable arguments/parameters list. Each key-value pair in the\n enclose object is effectively an argument-parameter pair.\n\n - `wrap`\n\n (default `undefined`) Pass a String to wrap all of the code in a closure.\n This is an easy way to make sure nothing is leaking. Variables that need to\n be public `exports` and `global` are made available. The value of wrap is\n the global variable exports will be available as.\n\n - `exportAll`\n\n (default `false`) Set to `true` to make all global functions and variables\n available via the `export` variable. Only available when using `wrap`.\n\n### Examples\n\nTo minify multiple files into a 'app.min.js' and create a source map:\n\n```js\ngulp.task('uglify', function() {\n gulp.src('public/js/*.js')\n .pipe(uglify('app.min.js', {\n outSourceMap: true\n }))\n .pipe(gulp.dest('dist/js'))\n});\n```\n\nTo minify multiple files from different paths to 'app.js', but skip mangling\nand beautify the results:\n\n```js\ngulp.task('uglify', function() {\n gulp.src(['public/js/*.js', 'bower_components/**/*.js'])\n .pipe(uglify('app.js', {\n mangle: false,\n output: {\n beautify: true\n }\n }))\n .pipe(gulp.dest('dist/js'))\n});\n```\n\n[npm-image]: http://img.shields.io/npm/v/gulp-uglifyjs.svg\n[npm-url]: https://www.npmjs.org/package/gulp-uglifyjs/\n\n[downloads-image]: http://img.shields.io/npm/dm/gulp-uglifyjs.svg\n\n[travis-url]: https://travis-ci.org/craigjennings11/gulp-uglifyjs\n[travis-image]: https://travis-ci.org/craigjennings11/gulp-uglifyjs.svg?branch=master\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/craigjennings11/gulp-uglifyjs/issues" }, "_id": "gulp-uglifyjs@0.6.2", "dist": { "shasum": "a6b3653b1f816a9593af9c3b37990d52fade4360" }, "deprecated": "Since gulp-sourcemaps now works, use gulp-uglify instead", "_from": "gulp-uglifyjs@", "_resolved": "https://registry.npmjs.org/gulp-uglifyjs/-/gulp-uglifyjs-0.6.2.tgz" }