import webpack from 'webpack';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import BabiliPlugin from 'babili-webpack-plugin';
import path from 'path';

const BUILD_PATH = path.resolve(__dirname, 'public');
const APP_DIR = `${path.resolve(__dirname)}/app`;

export default {
  devtool: 'cheap-eval-source-map',
  entry: `${APP_DIR}/index.js`,
  output: {
    path: BUILD_PATH,
    filename: 'bundle.js'
  },
  plugins: [
    new webpack.optimize.OccurrenceOrderPlugin(),
    new ExtractTextPlugin('style.css'),
    new BabiliPlugin()
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        include: [
          path.join(__dirname, 'app'),
          path.join(__dirname, 'server/shared')
        ],
        exclude: /node_modules/,
        loader: 'babel-loader'
      },
      {
        test: /\.jsx$/,
        include: [
          path.join(__dirname, 'app'),
          path.join(__dirname, 'server/shared')
        ],
        exclude: /node_modules/,
        loader: 'babel-loader'

      },
      {
        test: /\.scss$/,
        use: ExtractTextPlugin.extract({
          use: ['css-loader', 'sass-loader']
        })
      },
      {
        test: /\.css$/,
        loaders: ['style-loader', 'css-loader']
      },
      {
        test: /\.scss$/,
        loaders: ['style-loader', 'css-loader', 'sass-loader']
      },
      {
        test: /\.jpg$/,
        loader: 'file-loader'
      }
    ]
  }
};

@@ -1,13 +1,12 @@
-impor
+cons
 t webpac
@@ -7,21 +7,26 @@
 webpack 
-from 
+= require(
 'webpack
@@ -26,23 +26,53 @@
 webpack'
+)
 ;%0A
-impor
+const path = require('path');%0Acons
 t Extrac
@@ -83,21 +83,26 @@
 tPlugin 
-from 
+= require(
 'extract
@@ -122,23 +122,23 @@
 -plugin'
+)
 ;%0A
-impor
+cons
 t Babili
@@ -144,21 +144,26 @@
 iPlugin 
-from 
+= require(
 'babili-
@@ -181,33 +181,9 @@
 gin'
-;%0Aimport path from 'path'
+)
 ;%0A%0Ac

add build and postinstall scripts