var path = require('path');
var webpack = require('webpack');

var isProduction = process.env.NODE_ENV === 'production';

module.exports = {
  devtool: 'eval',
  entry: isProduction ?
    [ './src/index' ] :
    [
      'webpack-dev-server/client?http://localhost:3000',
      'webpack/hot/only-dev-server',
      './src/index'
    ],
  output: {
    path: path.join(__dirname, 'static'),
    filename: 'bundle.js',
    publicPath: isProduction ? 'static/' : '/static/'
  },
  plugins:  isProduction ?
    [new webpack.NoErrorsPlugin()] :
    [
      new webpack.HotModuleReplacementPlugin(),
      new webpack.NoErrorsPlugin()
    ],
  resolve: {
    extensions: ['', '.js', '.jsx']
  },
  module: {
    loaders: [{
      test: /\.jsx?$/,
      loaders: isProduction ? ['babel'] : ['react-hot', 'babel'],
      include: path.join(__dirname, 'src'),
      exclude: path.join(__dirname, 'src', 'demo', 'FormattedText.jsx')
    }, {
      test: /intl-messageformat\/dist\/locale-data\/.*/,
      loaders: ['imports?IntlMessageFormat=intl-messageformat']
    }]
  }
};

@@ -186,24 +186,29 @@
    %5B './src/
+demo/
 index' %5D :%0A 
@@ -319,16 +319,21 @@
  './src/
+demo/
 index'%0A 

fix index path