var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
  devtool: 'cheap-module-eval-source-map',
  entry: [
    'webpack-hot-middleware/client',
    './src/index.js'
  ],
  output: {
    path: path.join(__dirname, 'dist', 'assets'),
    filename: 'bundle.js',
    publicPath: '/assets/'
  },
  module: {
    preLoaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'eslint-loader'
      }
    ],
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: { presets: ['react', 'es2015', 'stage-2', 'react-hmre'] }
      },
      {
        test: /\.css$/,
        exclude: /node_modules/,
        loader: ExtractTextPlugin.extract('style-loader', ['css-loader', 'cssnext-loader', 'postcss-loader'])
      },
      {
        test: /\.(eot|woff|woff2|ttf|svg)(\?\S*)?$/,
        loader: 'file?name=fonts/[name].[ext]'
      },
      {
        test: /\.(jpg|jpeg|gif|png|svg)$/,
        loader:'file?name=images/[name].[ext]'
      }
    ]
  },
  postcss: function(webpack) {
    return [
      // Need this setting in order to enable hot-reloading when the other css files change
      // See: https://github.com/postcss/postcss-import#adddependencyto
      require('postcss-import')({addDependencyTo: webpack}),
      require("postcss-cssnext")(),
      require("postcss-url")(),
      require("cssnano")(),
      require('postcss-simple-vars')(),
      require("postcss-pxtorem")(),
      require("postcss-mixins")(),
      require("postcss-extend")(),
      require("postcss-browser-reporter")(),
      require("postcss-reporter")(),
      require('css-mqpacker')()
    ]
  },
  eslint: {
    configFile: './.eslintrc'
  },
  plugins: [
    new ExtractTextPlugin("main.css"),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    new webpack.ProvidePlugin({
      "React": "react"
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ],
  resolve: {
    extensions: ['', '.js']
  }
};

@@ -843,19 +843,32 @@
 ader
-', 'cssnext
+?autoprefixer', 'postcss
 -loa
@@ -870,29 +870,26 @@
 s-loader', '
-postc
+sa
 ss-loader'%5D)
@@ -1415,25 +1415,25 @@
 require(
-%22
+'
 postcss-
 cssnext%22
@@ -1428,16 +1428,12 @@
 css-
-cssnext%22
+url'
 )(),
@@ -1460,82 +1460,47 @@
 css-
-url%22)(),%0A      require(%22cssnano%22)(),%0A      require('postcss-simple-vars')(
+cssnext%22)(%7Bbrowsers: 'last 2 versions'%7D
 ),%0A 
@@ -1600,24 +1600,57 @@
 extend%22)(),%0A
+      require('css-mqpacker')(),%0A
       requir
@@ -1674,32 +1674,32 @@
 r-reporter%22)(),%0A
+
       require(%22p
@@ -1721,41 +1721,8 @@
 %22)()
-,%0A      require('css-mqpacker')()
 %0A   

clean webpack plugins up