
const path = require('path')
const cwd = process.cwd()
const HtmlWebpackPlugin = require('html-webpack-plugin')

/**
 * Config
 */
module.exports = {
  context: path.join(cwd, 'app'),

  entry: {
    app: ['./js/index.jsx'],
    common: ['react', 'react-dom', 'react-router', 'moment', 'material-ui']
  },

  output: {
    path: path.resolve('dist'),
    filename: 'bundle[name].js'
  },

  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loaders: ['react-hot-loader', 'babel-loader'],
        exclude: /node_modules/
      },
      {
        test: /\.css$/,
        loaders: [
          'style-loader',
          'css-loader',
        ]
      },
      {
        test: /\.scss$/,
        loaders: [
          'style-loader',
          'css-loader',
          'scss-loader'
        ]
      },
      {
        test: /\.(png|jpg|jpeg|gif|svg|eot|ttf|woff|woff2)$/,
        loaders: [
          'url-loader'
        ]
      }
    ]
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: './index.ejs',
    })
  ]
}

@@ -834,25 +834,8 @@
 /%5C.(
-png%7Cjpg%7Cjpeg%7Cgif%7C
 svg%7C
@@ -905,24 +905,133 @@
 '%0A        %5D%0A
+      %7D,%0A      %7B%0A        test: /%5C.(png%7Cjpg%7Cjpeg%7Cgif)$/,%0A        loaders: %5B%0A          'file-loader'%0A        %5D%0A
       %7D%0A    

load images as files instead of embedding