var webpack = require('webpack');

var EXTERNAL_PROMISE = '{Promise: Promise}';
var config = {};
var base = {
  entry: './index.js',
  output: {
    path: 'dist/',
    filename: 'axios.js',
    sourceMapFilename: 'axios.map',
    library: 'axios'
  },
  externals: [
    {
      './adapters/http': 'var undefined'
    }
  ],
  devtool: 'source-map'
};

['amd', 'global', 'amd-standalone', 'global-standalone'].forEach(function (key) {
  config[key] = JSON.parse(JSON.stringify(base));
  config[key + '-min'] = JSON.parse(JSON.stringify(base));

  config[key + '-min'].plugins = [
    new webpack.optimize.UglifyJsPlugin()
  ];
});

config['amd'].output.filename = 'axios.amd.js';
config['amd'].output.sourceMapFilename = 'axios.amd.map';
config['amd'].output.libraryTarget = 'amd';

config['amd-standalone'].output.filename = 'axios.amd.standalone.js';
config['amd-standalone'].output.sourceMapFilename = 'axios.amd.standalone.map';
config['amd-standalone'].output.libraryTarget = 'amd';
config['amd-standalone'].externals[0]['es6-promise'] = EXTERNAL_PROMISE;

config['amd-min'].output.filename = 'axios.amd.min.js';
config['amd-min'].output.sourceMapFilename = 'axios.amd.min.map';
config['amd-min'].output.libraryTarget = 'amd';

config['amd-standalone-min'].output.filename = 'axios.amd.standalone.min.js';
config['amd-standalone-min'].output.sourceMapFilename = 'axios.amd.standalone.min.map';
config['amd-standalone-min'].output.libraryTarget = 'amd';
config['amd-standalone-min'].externals[0]['es6-promise'] = EXTERNAL_PROMISE;

config['global-standalone'].output.filename = 'axios.standalone.js';
config['global-standalone'].output.sourceMapFilename = 'axios.standalone.map';
config['global-standalone'].externals[0]['es6-promise'] = EXTERNAL_PROMISE;

config['global-min'].output.filename = 'axios.min.js';
config['global-min'].output.sourceMapFilename = 'axios.min.map';

config['global-standalone-min'].output.filename = 'axios.standalone.min.js';
config['global-standalone-min'].output.sourceMapFilename = 'axios.standalone.min.map';
config['global-standalone-min'].externals[0]['es6-promise'] = EXTERNAL_PROMISE;

module.exports = config;


@@ -31,84 +31,118 @@
 ');%0A
-%0A
 var 
-EXTERNAL_PROMISE = '%7BPromise: Promise%7D';%0Avar config = %7B%7D;%0Avar base = %7B%0A
+config = %7B%7D;%0A%0Afunction generateConfig(name) %7B%0A  var uglify = name.indexOf('min') %3E -1;%0A  var config = %7B%0A  
   en
@@ -160,16 +160,18 @@
 ex.js',%0A
+  
   output
@@ -178,16 +178,18 @@
 : %7B%0A    
+  
 path: 'd
@@ -199,16 +199,18 @@
 /',%0A    
+  
 filename
@@ -211,22 +211,24 @@
 lename: 
-'axios
+name + '
 .js',%0A  
@@ -229,16 +229,18 @@
 s',%0A    
+  
 sourceMa
@@ -250,22 +250,24 @@
 lename: 
-'axios
+name + '
 .map',%0A 
@@ -269,16 +269,18 @@
 p',%0A    
+  
 library:
@@ -291,14 +291,46 @@
 ios'
+,
 %0A
+      libraryTarget: 'umd'%0A  
   %7D,%0A
+  
   ex
@@ -344,24 +344,26 @@
 : %5B%0A    
+  
 %7B%0A      
 './adapt
@@ -354,16 +354,18 @@
 %7B%0A      
+  
 './adapt
@@ -399,15 +399,21 @@
     
+  
 %7D%0A  
+  
 %5D,%0A
+  
   de
@@ -436,226 +436,41 @@
 ap'%0A
+  
 %7D;%0A
-%0A%5B'amd', 'global', 'amd-standalone', 'global-standalone'%5D.forEach(function (key) %7B%0A  config%5Bkey%5D = JSON.parse(JSON.stringify(base));%0A  config%5Bkey + '-min'%5D = JSON.parse(JSON.stringify(base));%0A%0A  config%5Bkey + '-min'%5D
+ %0A  if (uglify) %7B%0A    config
 .plu
@@ -482,16 +482,18 @@
 = %5B%0A    
+  
 new webp
@@ -524,1512 +524,196 @@
 gin(
-)%0A  %5D;%0A%7D);%0A%0Aconfig%5B'amd'%5D.output.filename = 'axios.amd.js';%0Aconfig%5B'amd'%5D.output.sourceMapFilename = 'axios.amd.map';%0Aconfig%5B'amd'%5D.output.libraryTarget = 'amd';%0A%0Aconfig%5B'amd-standalone'%5D.output.filename = 'axios.amd.standalone.js';%0Aconfig%5B'amd-standalone'%5D.output.sourceMapFilename = 'axios.amd.standalone.map';%0Aconfig%5B'amd-standalone'%5D.output.libraryTarget = 'amd';%0Aconfig%5B'amd-standalone'%5D.externals%5B0%5D%5B'es6-promise'%5D = EXTERNAL_PROMISE;%0A%0Aconfig%5B'amd-min'%5D.output.filename = 'axios.amd.min.js';%0Aconfig%5B'amd-min'%5D.output.sourceMapFilename = 'axios.amd.min.map';%0Aconfig%5B'amd-min'%5D.output.libraryTarget = 'amd';%0A%0Aconfig%5B'amd-standalone-min'%5D.output.filename = 'axios.amd.standalone.min.js';%0Aconfig%5B'amd-standalone-min'%5D.output.sourceMapFilename = 'axios.amd.standalone.min.map';%0Aconfig%5B'amd-standalone-min'%5D.output.libraryTarget = 'amd';%0Aconfig%5B'amd-standalone-min'%5D.externals%5B0%5D%5B'es6-promise'%5D = EXTERNAL_PROMISE;%0A%0Aconfig%5B'global-standalone'%5D.output.filename = 'axios.standalone.js';%0Aconfig%5B'global-standalone'%5D.output.sourceMapFilename = 'axios.standalone.map';%0Aconfig%5B'global-standalone'%5D.externals%5B0%5D%5B'es6-promise'%5D = EXTERNAL_PROMISE;%0A%0Aconfig%5B'global-min'%5D.output.filename = 'axios.min.js';%0Aconfig%5B'global-min'%5D.output.sourceMapFilename = 'axios.min.map';%0A%0Aconfig%5B'global-standalone-min'%5D.output.filename = 'axios.standalone.min.js';%0Aconfig%5B'global-standalone-min'%5D.output.sourceMapFilename = 'axios.standalone.min.map';%0Aconfig%5B'global-standalone-min'%5D.externals%5B0%5D%5B'es6-promise'%5D = EXTERNAL_PROMISE
+%7B%0A        compressor: %7B%0A          warnings: false%0A        %7D%0A      %7D)%0A    %5D;%0A  %7D%0A%0A  return config;%0A%7D%0A%0A%5B'axios', 'axios.min'%5D.forEach(function (key) %7B%0A  config%5Bkey%5D = generateConfig(key);%0A%7D)
 ;%0A%0Am

Converting to UMD