import webpack from 'webpack';
import path from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import autoprefixer from 'autoprefixer';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import loaders from './webpack.loaders';
import config from '../src/config';
import alias from './webpack.alias'

const HOST = config.server.host
const PORT = config.server.port

const src = path.join(__dirname, "..", "src")
const app = path.join(__dirname, "..", "app")
const node_modules = path.join(app, "node_modules")


export default {
    entry: [
        'webpack-hot-middleware/client',
        'webpack/hot/dev-server',
        path.join(src, 'index.jsx')
    ],
    devtool: process.env.WEBPACK_DEVTOOL || 'inline-source-map',
    output: {
        path: '/',
        publicPath: `http://${HOST}:${PORT}/`,
        filename: 'app.bundle.js'
    },
    resolve: {
        extensions: ['', '.js', '.jsx', '.css', '.scss', '.sass'],
        root: node_modules,
        alias: alias
    },
    module: { loaders },
    devServer: {
        contentBase: app,
        noInfo: false, //  --no-info option
        hot: true,
        inline: true,
        port: PORT,
        host: HOST
    },
    plugins: [
        new webpack.NoErrorsPlugin(),
        new webpack.HotModuleReplacementPlugin(),
        new HtmlWebpackPlugin({
            template: path.join(src, 'index.html')
        }),
        new webpack.DefinePlugin({
            'process.env': {
                'NODE_ENV': JSON.stringify('development')
            }
        }),
        new webpack.ProvidePlugin({
            $: "jquery",
            jQuery: "jquery",
            "window.jQuery": "jquery"
        })
    ],
    postcss: function () {
        return [autoprefixer, require('postcss-nested')];
    }
};

@@ -265,12 +265,8 @@
 '../
-src/
 conf
@@ -311,73 +311,8 @@
 s'%0A%0A
-const HOST = config.server.host%0Aconst PORT = config.server.port%0A%0A
 cons
@@ -452,17 +452,16 @@
 ules%22)%0A%0A
-%0A
 export d
@@ -604,73 +604,8 @@
  %5D,%0A
-    devtool: process.env.WEBPACK_DEVTOOL %7C%7C 'inline-source-map',%0A
     
@@ -657,33 +657,25 @@
 th: 
-%60http://$%7BHOST%7D:$%7BPORT%7D/%60
+config.server.url
 ,%0A  
@@ -705,22 +705,88 @@
 ndle.js'
-%0A    %7D
+,%0A        sourceMapFileName: 'app.bundle.map'%0A    %7D,%0A    devtool: 'eval'
 ,%0A    re
@@ -1088,32 +1088,60 @@
 rt: 
-PORT,%0A        host: HOST
+config.server.port,%0A        host: config.server.host
 %0A   

Use new config