Comparing version 2.0.0 to 2.1.1
16
index.js
var convert = require('convert-source-map') | ||
, through = require('through') | ||
, path = require('path') | ||
, ujs = require('uglify-js') | ||
module.exports = uglifyify | ||
function uglifyify(file) { | ||
function uglifyify(file, opts) { | ||
opts = opts || {} | ||
var buffer = '' | ||
var exts = [] | ||
.concat(opts.exts || []) | ||
.concat(opts.x || []) | ||
if (/\.json$/.test(file)) return through() | ||
if ( | ||
/\.json$/.test(file) || | ||
exts.length && | ||
exts.indexOf(path.extname(file)) === -1 | ||
) { | ||
return through() | ||
} | ||
@@ -11,0 +23,0 @@ return through(function write(chunk) { |
{ | ||
"name": "uglifyify", | ||
"version": "2.0.0", | ||
"version": "2.1.1", | ||
"description": "A browserify transform which minifies your code using UglifyJS2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -57,2 +57,19 @@ # uglifyify | ||
## File Extensions | ||
Sometimes, you don't want uglifyify to minify all of your files – for example, | ||
if you're using a transform to `require` CSS or HTML, you might get an error | ||
as uglify expects JavaScript and will throw if it can't parse what it's given. | ||
This is done using the `-x` or `--exts` transform options, e.g. from the | ||
command-line: | ||
``` bash | ||
browserify \ | ||
-t coffeeify \ | ||
-t [ uglifyify -x .js -x .coffee ] | ||
``` | ||
The above example will only minify `.js` and `.coffee` files, ignoring the rest. | ||
## Global Transforms | ||
@@ -59,0 +76,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6286
58
105