Skip to content

Commit

Permalink
Update plugin API as plugins are now constructors by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kevva committed Oct 24, 2014
1 parent 55e296a commit 7a9b141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/imagemin-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You can either map your files statically or [dynamically](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically).

```js
var mozjpeg = require('imagemin-mozjpeg').ctor;
var mozjpeg = require('imagemin-mozjpeg');

grunt.initConfig({
imagemin: { // Task
Expand Down
4 changes: 1 addition & 3 deletions tasks/imagemin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ module.exports = function (grunt) {
.use(Imagemin.svgo({ plugins: options.svgoPlugins || [] }));

if (options.use) {
options.use.forEach(function (Stream) {
imagemin.use(new Stream());
});
options.use.forEach(imagemin.use.bind(imagemin));
}

fs.stat(file.src[0], function (err, stats) {
Expand Down

0 comments on commit 7a9b141

Please sign in to comment.