text: var webpack = require('webpack');
  var cssnext = require('postcss-cssnext');
  var postcssFocus = require('postcss-focus');
  var postcssReporter = require('postcss-reporter');
  
  module.exports = {
    devtool: 'cheap-module-eval-source-map',
  
    entry: {
      app: [
        'eventsource-polyfill',
        'webpack-hot-middleware/client',
        'webpack/hot/only-dev-server',
        'react-hot-loader/patch',
        './client/index.js',
      ],
      vendor: [
        'react',
        'react-dom',
      ],
    },
  
    output: {
      path: __dirname,
      filename: 'app.js',
      publicPath: 'http://0.0.0.0:8000/',
    },
  
    resolve: {
      extensions: ['', '.js', '.jsx'],
      modules: [
        'client',
        'node_modules',
      ],
    },
  
    module: {
      loaders: [
        {
          test: /\.css$/,
          exclude: /node_modules/,
          loader: 'style-loader!css-loader?localIdentName=[name]__[local]__[hash:base64:5]&modules&importLoaders=1&sourceMap!postcss-loader',
        }, {
          test: /\.css$/,
          include: /node_modules/,
          loaders: ['style-loader', 'css-loader'],
        }, {
          test: /\.jsx*$/,
          exclude: [/node_modules/, /.+\.config.js/],
          loader: 'babel',
        }, {
          test: /\.(jpe?g|gif|png|svg)$/i,
          loader: 'url-loader?limit=10000',
        }, {
          test: /\.json$/,
          loader: 'json-loader',
        },
      ],
    },
  
    plugins: [
      // 热启动
      new webpack.HotModuleReplacementPlugin(),
      // commomsChunkPlugin 处理公共模块
      new webpack.optimize.CommonsChunkPlugin({
        name: 'vendor',
        minChunks: Infinity,
        filename: 'vendor.js',
      }),
      // 全局变量
      new webpack.DefinePlugin({
        'process.env': {
          CLIENT: JSON.stringify(true),
          'NODE_ENV': JSON.stringify('development'),
        }
      }),
    ],
    // postcss 配置，官网链接：http://postcss.org/
    postcss: () => [
      postcssFocus(),
      cssnext({
        browsers: ['last 2 versions', 'IE > 10'],
      }),
      postcssReporter({
        clearMessages: true,
      }),
    ],
  };
  