/* global __dirname */

'use strict';

var webpack = require('webpack');

var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');

module.exports = {
  context: __dirname + '/client',
  entry: {
    index: './js/index',
    embed: './js/embed'
  },
  output: {
    filename: '[name].bundle.js',
    chunkFilename: '[id].bundle.js',
    path: __dirname + '/public/js'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015']
        }
      },
      {
        test: /\.sass$/,
        loaders: ['style', 'css', 'sass']
      },
      {
        test: /\.jade$/,
        loaders: ['jade']
      }
    ]
  },
  sassLoader: {
    indentedSyntax: true
  },
  plugins: [commonsPlugin],
  node: {
    fs: 'empty' // needed for term.js
  }
};

@@ -65,16 +65,44 @@
 bpack');
+%0Avar path = require('path');
 %0A%0Avar co
@@ -200,16 +200,30 @@
 ontext: 
+ path.resolve(
 __dirnam
@@ -227,20 +227,19 @@
 name
- +
+,
  '
-/
 client'
+)
 ,%0A  

Fix webpack context path on windows