{"author":{"name":"Ben Ng","email":"me@benng.me","url":"http://benng.me"},"contributors":[{"name":"Jesús Leganés Combarro 'piranna'","email":"piranna@gmail.com","url":"http://pirannafs.blogspot.com.es"}],"name":"minifyify","description":"Minify your browserify bundles without losing the sourcemap","keywords":["uglify","browserify","transform","minify","envify","uglifyify","compress"],"version":"3.0.0-beta7","repository":{"type":"git","url":"git://github.com/ben-ng/minifyify.git"},"main":"./lib","dependencies":{"through":"2.3.x","concat-stream":"1.4.x","lodash.defaults":"2.4.x","lodash.foreach":"2.4.x","lodash.bind":"2.4.x","source-map":"0.1.x","uglify-js":"2.4.x","convert-source-map":"^0.3.3","tmp":"0.0.23"},"scripts":{"test":"jake test --trace"},"devDependencies":{"coffeeify":"latest","lodash.template":"latest","jsesc":"latest","utilities":"latest","concat-stream":"latest","browserify":"latest","jake":"latest","jquery-browserify":"latest","sourcemap-validator":"latest","backbone":"latest","hbsfy":"latest","envify":"latest","handlebars-runtime":"latest"},"optionalDependencies":{},"engines":{"node":"0.10.x"},"license":"MIT","bugs":{"url":"https://github.com/ben-ng/minifyify/issues"},"homepage":"https://github.com/ben-ng/minifyify","_id":"minifyify@3.0.0-beta7","dist":{"shasum":"bc19530d2637fc14ba4eada72e2a256d5d19073b","tarball":"http://registry-npm.ywwl.com/minifyify/download/minifyify-3.0.0-beta7.tgz","integrity":"sha512-F8RN49+jCSU1iLDbDaqJEoOknUDAY9A7L6ydyu5ujuqCsptilfwOoN9mnQFgwFW/Npqevf61+LwHuhIZR/IePw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzkL5htpogbg10VasTCnz4A200DvP5+jikWCjuyCBQewIgUGQBLx299BPkSeHYK44F8UeFwyobL20r9sHba3r3amo="}],"size":176740,"noattachment":false,"key":"/minifyify/-/minifyify-3.0.0-beta7.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"benng","email":"me@benng.me"},"maintainers":[{"name":"benng","email":"me@benng.me"}],"directories":{},"readme":"Minifyify\n=========\n#### Tiny, Debuggable Browserify Bundles\n\n[![Build Status](https://travis-ci.org/ben-ng/minifyify.png?branch=master)](https://travis-ci.org/ben-ng/minifyify) [![Downloads](https://img.shields.io/npm/dm/minifyify.svg)](https://npmjs.com/package/minifyify) [![Dependency Status](https://david-dm.org/ben-ng/minifyify.svg)](https://david-dm.org/ben-ng/minifyify)\n\n## WARNING: Unmaintained!\n\nI have stopped writing Javascript full-time, and therefore do not use Minifyify anymore. While I will continue to accept pull requests and keep the test suite running, you should consider better-maintained alternatives, such as [uglifyify](https://github.com/hughsk/uglifyify). Thank you for your support!\n\n## Why use Minifyify?\n\nBefore, browserify made you choose between sane debugging and sane load times. Now, you can have both.\n\nMinifyify is a browserify plugin that minifies your code. The magic? The sourcemap points back to the original, separate source files.\n\nNow you can deploy a minified bundle in production, and still have meaningful stack traces when things inevitably break!\n\n## Advantages\n\nThere are advantages to using minifyify over your current minification solution:\n\n\n * Reliability\n\nIf you are currently using uglifyify and realized that your sourcemap is behaving strangely, you're not alone. Minifyify builds its own sourcemap instead of depending on uglify-js's `insourcemap` option, and has proven to be more reliable in practice.\n\n * Smaller Bundles\n\nIf you are currently running uglify-js on the bundle browserify outputs, minifyify can give you a smaller bundle because it removes dead code before browserify processes requires in it.\n\nFor example:\n```javascript\nif(process.env.browser) {\n  var realtime = require('socket-io.client')\n}\nelse {\n  var realtime = require('socket-io')\n}\n```\n\nOnly one of the required modules will be in your output bundle, because minifyify runs uglify on each individual file before browserify does its bundling.\n\n * A Neater Web Inspector\n\nMinifyify allows you to transform those obnoxious absolute paths in your web inspector with `compressPath`.\n\n * CoffeeScript Support\n\n~~Minifyify is tested against CoffeeScript, and can map minified code all the way back to the original `.coffee` files.~~\n\nCoffeeScript support is janky because of [this issue](https://github.com/jashkenas/coffeescript/issues/3672). The sourcemap that `coffee-script` produces is wrong, so I had to skip over minifyify's CoffeeScript test. minifyify won't crash, but the test suite validates sourcemaps for correctness. Use at your own risk!\n\n## Usage\n\n### Programmatic API\n```js\nvar browserify = require('browserify')\n    // As of browserify 5, you must enable debug mode in the constructor to use minifyify\n  , bundler = new browserify({debug: true});\n\nbundler.add('entry.js');\n\nbundler.plugin('minifyify', {map: 'bundle.js.map'});\n\nbundler.bundle(function (err, src, map) {\n  // Your code here\n});\n```\n\nThe map option should be the location of the sourcemap on your server, and is used to insert the `sourceMappingURL` comment in `src`.\n\n### Command Line\n```sh\n$ browserify entry.js -d -p [minifyify --map bundle.js.map --output bundle.js.map] > bundle.js\n```\n\nThe `--output` option is a required option on the command line interface and specifies where minifyify should write the sourcemap to on disk.\n\nPassing options to uglify-js is as easy as passing extra parameters in as an `uglify` object.\n\n```sh\n$ browserify entry.js -d -p [minifyify --map bundle.js.map --output bundle.js.map --uglify [ --compress [ --dead_code--comparisons 0 ] ] ] > bundle.js\n```\n\nIn the example above, if you want to invoke minifyify to only minify\nwithout generating any source maps or references to it (which is done\nby setting `[options.map]` to `false` programatically), you can pass\n`--no-map` instead of `--map` and `--output`, like this:\n\n```sh\n$ browserify entry.js -d -p [minifyify --no-map] > bundle.js\n```\n\n\n## Options\n\n### [options.compressPath]\n\nShorten the paths you see in the web inspector by defining a compression function.\n\n```\n// A typical compressPath function\ncompressPath: function (p) {\n  return path.relative('my-app-root', p);\n}\n```\n\nIf a string is provided, it will be used instead of `my-app-root` in the function above. This is useful if you are working from the command line and cannot define a function.\n\nDefaults to a no-op (absolute paths to all source files).\n\n### [options.map]\n\nThis is added to the bottom of the minified source file, and should point to where the map will be accessible from on your server. [More details here](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-howwork).\n\nExample: If your bundle is at `mysite.com/bundle.js` and the map is at `mysite.com/map.js`, set `options.map = '/map.js'`\n\nSet to `false` to minify, but not produce a source map or append the source map URL comment.\n\n### [options.minify]\n\nSet to false to disable minification and source map transforms. This essentially turns minifyify into a pass-thru stream.\n\nIf you set it to an object, it will be passed as the options argument to `uglify.minify`.\n\n### [options.output]\n\nSpecify a path to write the sourcemap to. Required when using the CLI, optional when working programmatically.\n\n### [options.uglify]\n\nWill be passed to `uglify.minify`\n\n### [options.include]\n\nPattern(s) matching the files you want included. Defaults to '**/*' (include everything).\n`null`/`undefined`, a single string, and an array of strings are all acceptable values.\nYou have the full range of [glob](https://github.com/isaacs/node-glob#glob-primer)\npatterns available to you, so you can do `app/{moduleA,moduleB}/*.js`, etc.\n\n### [options.exclude]\n\nPattern(s) matching the files you want excluded. By default _nothing_ is excluded.\nLike `include`; null, a string, and an array of strings are all acceptable.\nExclude always wins over include.\nIf a file matches both the `include` and `exclude` pattern arrays, it will be excluded.\n\n### [options.base]\n\nBy default all glob strings are matched against relative paths from `process.cwd()` (your projects base directory).\nThis option allows you to changed that. `base:'subDirA'` means evaluate globs relative from that sub directory.\n`base:'/'` means test your glob pattern against absolute file paths.\n\n## FAQ\n\n * PARSE ERROR!\n\n   Are you using `brfs`? Pin it to version `1.0.2`. See issue #44 for details.\n\n * Wait.. Why did the total size (source code + map) get BIGGER??\n\n   It's not immediately obvious, but the more you minify code, the bigger the sourcemap gets. Browserify can get away with merely mapping lines to lines because it is going from uncompressed code to uncompressed code. Minifyify squishes multiple lines together, so the sourcemap has to carry more information.\n\n   This is OK because the sourcemap is in a separate file, which means your app will be snappy for your users as their browsers won't download the sourcemap.\n\n * How does this work?\n\n   Minifyify runs UglifyJS on each file in your bundle, and transforms browserify's sourcemap to map to the original files.\n\n * Why does the sourcemap cause my debugger to behave erratically?\n\n   Some of the optimizations UglifyJS performs will result in sourcemaps that appear to broken. For example, when UglifyJS uses the comma operator to shorten statements on different lines, a single debugger \"step\" in minified code may execute multiple lines of the original source.\n\n   Another common example of erratic behavior is when code like this is compressed:\n\n   ```\n   var myThing = myFunc('a')\n     , cantGetHere = myFunc('b');\n   ```\n\n   If you set a breakpoint on the second line, your debugger might not pause execution there. I've found that setting the breakpoint on the first line and stepping onto the second line is more reliable.\n\n## Other Modules\n\nminifyify not working for you? try [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps).\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013-2014 Ben Ng\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","publish_time":1400139103672,"_cnpm_publish_time":1400139103672,"dist-tags":{"latest":"7.3.5"}}