grunt-contrib-compress
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "grunt-contrib-compress", | ||
"description": "Compress files and folders", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"author": { | ||
@@ -21,3 +21,2 @@ "name": "Grunt Team", | ||
"chalk": "^1.1.1", | ||
"iltorb": "^1.0.13", | ||
"lodash": "^4.7.0", | ||
@@ -27,2 +26,5 @@ "pretty-bytes": "^3.0.1", | ||
}, | ||
"optionalDependencies": { | ||
"iltorb": "^1.0.13" | ||
}, | ||
"devDependencies": { | ||
@@ -29,0 +31,0 @@ "grunt": "^1.0.0", |
@@ -1,2 +0,2 @@ | ||
# grunt-contrib-compress v1.4.0 [](https://travis-ci.org/gruntjs/grunt-contrib-compress) [](https://ci.appveyor.com/project/gruntjs/grunt-contrib-compress/branch/master) | ||
# grunt-contrib-compress v1.4.1 [](https://travis-ci.org/gruntjs/grunt-contrib-compress) [](https://ci.appveyor.com/project/gruntjs/grunt-contrib-compress/branch/master) | ||
@@ -276,3 +276,4 @@ > Compress files and folders | ||
* 2017-01-18 v1.4.0 Add support for `brotli` | ||
* 2017-01-20 v1.4.1 Make brotli support optional. | ||
* 2017-01-18 v1.4.0 Add support for brotli. | ||
* 2016-05-24 v1.3.0 Update archiver to v1.0. Fix node 6 support. | ||
@@ -320,2 +321,2 @@ * 2016-03-24 v1.2.0 Dependency update. | ||
*This file was generated on Wed Jan 18 2017 22:23:26.* | ||
*This file was generated on Fri Jan 20 2017 00:08:45.* |
@@ -14,3 +14,10 @@ /* | ||
var compress = require('./lib/compress')(grunt); | ||
var iltorb; | ||
try { | ||
iltorb = require('iltorb'); | ||
} catch (er) { | ||
iltorb = null; | ||
} | ||
grunt.registerMultiTask('compress', 'Compress files.', function() { | ||
@@ -29,4 +36,9 @@ compress.options = this.options({ | ||
if (compress.options.mode.match('brotli') && !iltorb) { | ||
grunt.fail.fatal('iltorb dependency wasn\'t found; in order to use brotli, ' + | ||
'make sure you have a supported C++ compiler available and run `npm install` again.'); | ||
} | ||
if (_.includes(['zip', 'tar', 'tgz', 'gzip', 'deflate', 'deflateRaw', 'brotli'], compress.options.mode) === false) { | ||
grunt.fail.warn('Mode ' + String(compress.options.mode).cyan + ' not supported.'); | ||
grunt.fail.warn('Mode ' + String(compress.options.mode) + ' not supported.'); | ||
} | ||
@@ -33,0 +45,0 @@ |
@@ -19,4 +19,11 @@ /* | ||
var _ = require('lodash'); | ||
var iltorb = require('iltorb'); | ||
var iltorb; | ||
try { | ||
iltorb = require('iltorb'); | ||
} catch (er) { | ||
iltorb = null; | ||
} | ||
module.exports = function(grunt) { | ||
@@ -108,4 +115,10 @@ | ||
var compressor = extension === 'br' ? algorithm.call(iltorb, exports.options.brotli) : algorithm.call(zlib, exports.options); | ||
var compressor; | ||
if (iltorb && extension === 'br') { | ||
compressor = algorithm.call(iltorb, exports.options.brotli); | ||
} else { | ||
compressor = algorithm.call(zlib, exports.options); | ||
} | ||
compressor.on('error', function(err) { | ||
@@ -112,0 +125,0 @@ grunt.log.error(err); |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25423
271
321
0
- Removediltorb@^1.0.13