From a34a2b0e24ff8f39c9a749ba69b687b16e32dc02 Mon Sep 17 00:00:00 2001 From: Arthur Stolyar Date: Sun, 4 Oct 2015 16:03:42 +0300 Subject: [PATCH 1/2] Fix minify option --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 90bd2b7..b35fc9d 100644 --- a/index.js +++ b/index.js @@ -259,9 +259,9 @@ HtmlWebpackPlugin.prototype.postProcessHtml = function(html, assets) { if (self.options.minify) { var minify = require('html-minifier').minify; try { - return minify(html, this.options.minify); + return minify(html, self.options.minify); } catch(e) { - Promise.reject(e); + return Promise.reject(e); } } return html; From 5db310fa02e3b6763c7a92240fba3a53c0f17d88 Mon Sep 17 00:00:00 2001 From: Arthur Stolyar Date: Sun, 4 Oct 2015 17:39:02 +0300 Subject: [PATCH 2/2] Eliminate redundant try..catch --- index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index b35fc9d..1644144 100644 --- a/index.js +++ b/index.js @@ -258,12 +258,9 @@ HtmlWebpackPlugin.prototype.postProcessHtml = function(html, assets) { .then(function(html) { if (self.options.minify) { var minify = require('html-minifier').minify; - try { - return minify(html, self.options.minify); - } catch(e) { - return Promise.reject(e); - } + return minify(html, self.options.minify); } + return html; }); };