ember-cli-deploy-gzip
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -1,10 +0,16 @@ | ||
# Change Log | ||
# Changelog | ||
## [0.2.1](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/tree/0.2.1) (2016-02-06) | ||
[Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/compare/v0.2.0...0.2.1) | ||
## [0.2.2](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/tree/v0.2.2) (2016-02-26) | ||
[Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/compare/v0.2.1...v0.2.2) | ||
- Add ignorePattern option for removing specific files [#18](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/pull/18) ([@jrjohnson](https://github.com/jrjohnson)) | ||
- Fix the plugin return object for keep-enabled gzipping [#19](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/pull/19) ([@dannyfallon/df](https://github.com/dannyfallon/df)) | ||
## [0.2.1](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/tree/v0.2.1) (2016-02-06) | ||
[Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/compare/v0.2.0...v0.2.1) | ||
- Update ember-deploy-plugin version again | ||
## [0.2.0](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/tree/0.2.0) (2016-02-06) | ||
[Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/compare/v0.1.1...0.2.0) | ||
## [0.2.0](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/tree/v0.2.0) (2016-02-06) | ||
[Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/compare/v0.1.1...v0.2.0) | ||
@@ -11,0 +17,0 @@ - Add the gzipped file to the context's distFiles when keep is true [\#17](https://github.com/ember-cli-deploy/ember-cli-deploy-gzip/pull/17) ([dannyfallon](https://github.com/dannyfallon)) |
24
index.js
@@ -24,2 +24,3 @@ /* jshint node: true */ | ||
filePattern: '**/*.{js,css,json,ico,map,xml,txt,svg,eot,ttf,woff,woff2}', | ||
ignorePattern: null, | ||
zopfli: false, | ||
@@ -48,9 +49,11 @@ keep: false, | ||
var filePattern = this.readConfig('filePattern'); | ||
var distDir = this.readConfig('distDir'); | ||
var distFiles = this.readConfig('distFiles') || []; | ||
var keep = this.readConfig('keep'); | ||
var filePattern = this.readConfig('filePattern'); | ||
var ignorePattern = this.readConfig('ignorePattern'); | ||
var distDir = this.readConfig('distDir'); | ||
var distFiles = this.readConfig('distFiles') || []; | ||
var keep = this.readConfig('keep'); | ||
this.log('gzipping `' + filePattern + '`', { verbose: true }); | ||
return this._gzipFiles(distDir, distFiles, filePattern, keep) | ||
this.log('ignoring `' + ignorePattern + '`', { verbose: true }); | ||
return this._gzipFiles(distDir, distFiles, filePattern, ignorePattern, keep) | ||
.then(function(gzippedFiles) { | ||
@@ -61,5 +64,5 @@ self.log('gzipped ' + gzippedFiles.length + ' files ok', { verbose: true }); | ||
return { | ||
distFiles: gzippedFiles, | ||
distFiles: [].concat(gzippedFiles), // needs to be a copy | ||
gzippedFiles: gzippedFiles | ||
} | ||
}; | ||
} | ||
@@ -70,4 +73,9 @@ return { gzippedFiles: gzippedFiles }; | ||
}, | ||
_gzipFiles: function(distDir, distFiles, filePattern, keep) { | ||
_gzipFiles: function(distDir, distFiles, filePattern, ignorePattern, keep) { | ||
var filesToGzip = distFiles.filter(minimatch.filter(filePattern, { matchBase: true })); | ||
if (ignorePattern != null) { | ||
filesToGzip = filesToGzip.filter(function(path){ | ||
return !minimatch(path, ignorePattern, { matchBase: true }); | ||
}); | ||
} | ||
return Promise.map(filesToGzip, this._gzipFile.bind(this, distDir, keep)); | ||
@@ -74,0 +82,0 @@ }, |
{ | ||
"name": "ember-cli-deploy-gzip", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Ember CLI Deploy plugin to gzip files.", | ||
@@ -60,2 +60,2 @@ "directories": { | ||
} | ||
} | ||
} |
@@ -60,2 +60,8 @@ # ember-cli-deploy-gzip | ||
### ignorePattern | ||
Files matching this pattern will *not* be gzipped even if they match filePattern | ||
*Default:* null | ||
### distDir | ||
@@ -62,0 +68,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
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
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
17209
111
111
1