/**
 * Plugins for optimising the Webpack build
 *
 * @package: Everledger JS Toolchain
 * @author:  pospi <sam@everledger.io>
 * @since:   2016-10-06
 * @flow
 */

const { compose } = require('ramda');
const webpack = require('webpack');
const plugin = require('webpack-partial/plugin').default;

module.exports = compose(
  plugin(new webpack.optimize.OccurrenceOrderPlugin()),
  plugin(new webpack.optimize.UglifyJsPlugin({
    comments: false,
    compress: {
      warnings: false,
    },
  }))
);

@@ -371,19 +371,177 @@
 lugin())
-,%0A 
+%0A%0A  // :TODO: make this work with babel%0A  // @see https://github.com/webpack/webpack/issues/1659%0A  // @see https://github.com/boopathi/babili-webpack-plugin%0A  //
  plugin(
@@ -579,16 +579,19 @@
 ugin(%7B%0A 
+ //
    comme
@@ -604,18 +604,21 @@
 alse,%0A  
+//
   
+ 
 compress
@@ -622,16 +622,19 @@
 ess: %7B%0A 
+ //
      war
@@ -652,15 +652,21 @@
 e,%0A 
+ //
    %7D,%0A 
+ //
  %7D))

disable uglify plugin as it currently has issues with transpiled code