const webpack = require("webpack");
const path = require("path");
const nodeExternals = require("webpack-node-externals");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
  entry: [
    "babel-polyfill",
    "./src/index.tsx",
  ],

  module: {
      loaders: [
        // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
        { test: /\.tsx?$/, loaders: ["babel-loader?presets[]=es2015&presets[]=stage-0", "ts-loader"] },
        { test: /\.scss$/, loader: ExtractTextPlugin.extract({ fallbackLoader: "style-loader",
          loader: "css-loader!sass-loader"})},
        { test: /\.css$/, loader: ExtractTextPlugin.extract({fallbackLoader: "style-loader", loader: "css"}) },
        { test: /\.(jpe?g|png|gif|svg|eot|woff|svg|ttf|json)/, loader: "file-loader" },
      ],
  },

  output: {
    filename: "bundle.js",
    path: __dirname + "/dist",
  },

  plugins: [
    new ExtractTextPlugin("[name].css"),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: false,
    }),
    new webpack.DefinePlugin({
      "process.env": {
        NODE_ENV: JSON.stringify("production"),
      },
    }),
    new HtmlWebpackPlugin({
      template: "src/assets/index.html",
    }),
  ],

  resolve: {
      alias: {
        src: path.join(__dirname, "/src"),
      },
      // Add '.ts' and '.tsx' as resolvable extensions.
      extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"],
  },
};
@@ -269,22 +269,30 @@
  entry: 
-%5B
+%7B
 %0A    
+index: %5B
 %22babel-p
@@ -300,20 +300,16 @@
 lyfill%22,
-%0A   
  %22./src/
@@ -318,21 +318,272 @@
 dex.tsx%22
+%5D
 ,%0A  
-%5D
+  vendor: %5B%22react%22, %22antd%22, %22superagent%22, %22redux%22, %22lodash%22, %22nprogress%22, %22rc-animate%22, %22moment%22,%0A      %22json-format%22, %22react-addons-css-transition-group%22, %22react-dom%22, %22react-router%22,%0A      %22react-router-redux%22, %22redux-actions%22, %22redux-promise%22%5D,%0A  %7D
 ,%0A%0A  mod
@@ -1279,24 +1279,117 @@
 ame%5D.css%22),%0A
+    new webpack.optimize.CommonsChunkPlugin(%7Bname: %22vendor%22, filename: %22vendor.bundle.js%22%7D),%0A
     new webp

split vendor code out of bundle