text: import webpack from 'webpack'
  import path from 'path'
  import HtmlWebpackPlugin from 'html-webpack-plugin'
  const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
    template: __dirname + '/app/index.html',
    filename: 'index.html',
    inject: 'body',
  })
  
  const PATHS = {
    app: path.join(__dirname, 'app/index.js'),
    build: path.join(__dirname, 'dist'),
  }
  
  const LAUNCH_COMMAND = process.env.npm_lifecycle_event
  
  const isProduction = LAUNCH_COMMAND === 'production'
  process.env.BABEL_ENV = LAUNCH_COMMAND
  
  const productionPlugin = new webpack.DefinePlugin({
    'process.env': {
      NODE_ENV: JSON.stringify('production')
    }
  })
  
  const base = {
    entry: [
      PATHS.app,
    ],
    output: {
      path: PATHS.build,
      filename: 'index_bundle.js',
    },
    module: {
      loaders: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel-loader'
        },
        {
          test: /\.css$/,
          loader: 'style!css?sourceMap&modules&localIdentName=[name]__[local]__[hash:base64:5]'
        }
      ]
    },
    resolve: {
      root: path.resolve('./app')
    }
  }
  
  const developmentConfig = {
    devtool: 'cheap-module-iimportne-source-map',
    devServer: {
      contentBase: PATHS.build,
      hot: true,
      inline: true,
      progress: true,
    },
    plugins: [HtmlWebpackPluginConfig, new webpack.HotModuleReplacementPlugin()]
  }
  
  const productionCongig = {
    devtool: 'cheap-module-source-map',
    plugins: [HtmlWebpackPluginConfig, productionPlugin]
  }
  
  export default Object.assign({}, base,
    isProduction === true ? productionCongig : developmentConfig
  )
  