diff --git a/.travis.yml b/.travis.yml
index f98fed0..94ab01f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,4 +2,3 @@ language: node_js
node_js:
- '12'
- '10'
- - '8'
diff --git a/index.js b/index.js
index c544740..e67929b 100644
--- a/index.js
+++ b/index.js
@@ -13,7 +13,7 @@ const defaultPlugins = ['gifsicle', 'mozjpeg', 'optipng', 'svgo'];
const loadPlugin = (plugin, ...args) => {
try {
return require(`imagemin-${plugin}`)(...args);
- } catch (error) {
+ } catch (_) {
log(`${PLUGIN_NAME}: Couldn't load default plugin "${plugin}"`);
}
};
@@ -34,7 +34,7 @@ const getDefaultPlugins = () =>
module.exports = (plugins, options) => {
if (typeof plugins === 'object' && !Array.isArray(plugins)) {
options = plugins;
- plugins = null;
+ plugins = undefined;
}
options = {
diff --git a/package.json b/package.json
index d04088b..6b220d6 100644
--- a/package.json
+++ b/package.json
@@ -4,13 +4,14 @@
"description": "Minify PNG, JPEG, GIF and SVG images",
"license": "MIT",
"repository": "sindresorhus/gulp-imagemin",
+ "funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
- "node": ">=8"
+ "node": ">=10"
},
"scripts": {
"test": "xo && ava"
@@ -35,7 +36,7 @@
"svg"
],
"dependencies": {
- "chalk": "^2.4.1",
+ "chalk": "^3.0.0",
"fancy-log": "^1.3.2",
"imagemin": "^7.0.0",
"plugin-error": "^1.0.1",
@@ -48,7 +49,7 @@
"get-stream": "^5.1.0",
"imagemin-pngquant": "^8.0.0",
"vinyl": "^2.2.0",
- "xo": "^0.24.0"
+ "xo": "^0.25.3"
},
"optionalDependencies": {
"imagemin-gifsicle": "^6.0.1",
diff --git a/readme.md b/readme.md
index 4ee52e0..34189a1 100644
--- a/readme.md
+++ b/readme.md
@@ -4,14 +4,12 @@
*Issues with the output should be reported on the [`imagemin` issue tracker](https://github.com/imagemin/imagemin/issues).*
-
## Install
```
$ npm install --save-dev gulp-imagemin
```
-
## Usage
### Basic
@@ -80,7 +78,6 @@ Note that you may come across an older, implicit syntax. In versions < 3, the sa
// …
```
-
## API
Comes bundled with the following **lossless** optimizers:
@@ -98,7 +95,7 @@ Unsupported files are ignored.
#### plugins
-Type: `Array`
+Type: `Array`\
Default: `[imagemin.gifsicle(), imagemin.mozjpeg(), imagemin.optipng(), imagemin.svgo()]`
[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use. This will completely overwrite all the default plugins. So, if you want to use custom plugins and you need some of defaults too, then you should pass default plugins as well. Note that the default plugins come with good defaults and should be sufficient in most cases. See the individual plugins for supported options.
@@ -109,7 +106,7 @@ Type: `object`
##### verbose
-Type: `boolean`
+Type: `boolean`\
Default: `false`
Enabling this will log info on every image passed to `gulp-imagemin`:
@@ -121,7 +118,7 @@ gulp-imagemin: ✔ image2.png (saved 91 B - 0.4%)
##### silent
-Type: `boolean`
+Type: `boolean`\
Default: `false`
Don't log the number of images that have been minified.