'use strict';


const Promise  = require('bluebird');


module.exports = function (context) {
  return Promise.resolve().then(() => {
    const UglifyJS = require('uglify-js');

    let result = UglifyJS.minify(context.asset.source, {
      // turn off side effects to prevent uglify from simplifying
      // "browser-pack/prelude.js" IIFE down to a constant
      compress: { side_effects: false }
    });

    if (result.error) throw result.error;

    // Special case for "browser-pack/prelude.js": if source will be empty after
    // compression - skip compression, because file may be included by macros.
    if (result.code !== '') {
      context.asset.source = result.code;
    }
  });
};

@@ -241,52 +241,15 @@
  // 
-turn off side effects to prevent uglify from
+prevent
  sim
@@ -256,25 +256,16 @@
 plifying
-%0A      //
  %22browse
@@ -287,31 +287,29 @@
 js%22 
-IIFE down to a constant
+when used in a macros
 %0A   
@@ -327,26 +327,23 @@
 : %7B 
-side_effects: fals
+expression: tru
 e %7D%0A

Fix minification issue (again)