From 1e2e935f18a1fa723773fe83e9daa1cdaf05d514 Mon Sep 17 00:00:00 2001 From: Pafcal Date: Thu, 27 Jun 2019 08:00:08 +0300 Subject: [PATCH] V3.2.1: added a warning message in case both silent and detailed logs are true --- README.md | 3 +-- package.json | 2 +- plugin.js | 8 ++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f193d1..2ea3966 100644 --- a/README.md +++ b/README.md @@ -111,8 +111,7 @@ This options tells the plugin to also log the size difference per converted imag Type: `boolean`
Default: `false` -In case you don't want anything printed to the console set this option to false.
-*see the `detailedLogs` option for what this plugin prints by dafault +In case you don't want anything printed to the console set this option to false. This will override the `detailedLogs` option.
#### strict diff --git a/package.json b/package.json index 3270dda..0496f0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "imagemin-webp-webpack-plugin", - "version": "3.2.0", + "version": "3.2.1", "description": "Webpack plugin which converts images to the WebP format while also keeping the original files.", "author": { "name": "Alexandru Pavaloi", diff --git a/plugin.js b/plugin.js index 6372d0b..d0077a8 100644 --- a/plugin.js +++ b/plugin.js @@ -29,6 +29,14 @@ class ImageminWebpWebpackPlugin { let assetNames = Object.keys(compilation.assets); let nrOfImagesFailed = 0; + if(this.silent && this.detailedLogs) { + compilation.warnings.push( + new Error( + `ImageminWebpWebpackPlugin: both the 'silent' and 'detailedLogs' options are true. Overriding 'detailedLogs' and disabling all console output.` + ) + ); + } + Promise.all(assetNames.map(name => { for (let i = 0; i < this.config.length; i++) { if (this.config[i].test.test(name)) {