const webpack = require('webpack');
const path = require('path');

const NODE_ENV = process.env.NODE_ENV || 'development';

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'index.js',
    path: path.resolve(__dirname, 'lib'),
    library: 'numberFormatter',
    libraryTarget: 'umd',
  },
  module: {
	  rules: [
	  	{
	  		test: /\.js$/,
	  		exclude: /node_modules/,
		  	use: [
		  		{
		  			loader: 'babel-loader',
		  		},
		  	],
		  },
	  ],
	},
	devtool: NODE_ENV === 'development' ? 'cheap-inline-source-map' : null,
	watch: NODE_ENV === 'development',
	resolve: {
		extensions: ['.js'],
		modules: [
    	path.join(__dirname, 'src'),
     	'node_modules',
  	],
	},
};

@@ -117,16 +117,223 @@
 ment';%0A%0A
+const plugins = %5B%5D;%0A%0Aif (NODE_ENV === 'production') %7B%0A  plugins.push(%0A    new webpack.optimize.UglifyJsPlugin(%7B%0A      compress: %7B%0A        warnings: false,%0A        drop_console: false,%0A      %7D%0A    %7D)%0A  );%0A%7D%0A%0A
 module.e
@@ -749,12 +749,13 @@
 ' : 
-null
+false
 ,%0A%09w
@@ -788,16 +788,36 @@
 pment',%0A
+  plugins: plugins,%0A
 %09resolve

add uglifyjs if NODE_ENV=production