const minify        = require('html-minifier').minify;
const webpackUtils  = require('./webpack_utils');

module.exports = function applyHtmlPaths(html, production, webpackAssets, buildSuffix) {

  const updatedHtml = webpackUtils.apply(
    html,
    webpackAssets,
    buildSuffix
  );

  if (production) {
    return minify(updatedHtml, {
      removeComments: true,
      collapseWhitespace: true,
      minifyJS: true
    });
  }

  return updatedHtml;

};

@@ -6,23 +6,16 @@
  minify 
-       
 = requir
@@ -60,17 +60,16 @@
 ckUtils 
- 
 = requir
@@ -89,16 +89,46 @@
 utils');
+%0Aconst log = require('./log');
 %0A%0Amodule
@@ -324,16 +324,28 @@
 tion) %7B%0A
+    try %7B%0A  
     retu
@@ -375,16 +375,18 @@
 %7B%0A      
+  
 removeCo
@@ -395,24 +395,26 @@
 ents: true,%0A
+  
       collap
@@ -439,16 +439,18 @@
 ,%0A      
+  
 minifyJS
@@ -464,12 +464,121 @@
     
+  
 %7D);%0A
+    %7D catch (err) %7B%0A      log.out(%60Unable to minify html. Error: $%7Berr%7D%60);%0A      return updatedHtml;%0A    %7D%0A
   %7D%0A

catch minify errors