var webpack = require('webpack')
var autoprefixer = require('autoprefixer')
var CompressionPlugin = require('compression-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var env = process.env.NODE_ENV
var isProduction = env === 'production'
console.log('Building for ' + env + '...')

var commonPlugins = [
  new webpack.DefinePlugin({
    'process.env': {
      BROWSER: JSON.stringify(true),
      NODE_ENV: JSON.stringify(env)
    }
  }),
  new ExtractTextPlugin('app.bundle.css', { allChunks: true }),
  new webpack.optimize.CommonsChunkPlugin({
    name: 'react',
    filename: 'react.bundle.js'
  }),
  new webpack.optimize.CommonsChunkPlugin({
    names: [''],
    filename: 'init.bundle.js',
    minChunks: Infinity
  })
]
var productionPlugins = [
  new webpack.optimize.DedupePlugin(),
  new webpack.optimize.AggressiveMergingPlugin(),
  new webpack.optimize.UglifyJsPlugin({
    comments: false,
    compress: {
      warnings: false
    }
  }),
  new CompressionPlugin({
    asset: '[path].gz[query]',
    algorithm: 'gzip',
    test: /\.js$|\.html|\.css$/,
    threshold: 256
  })
]

module.exports = {
  devtool: isProduction ? 'cheap-module-source-map' : 'eval',
  entry: {
    app: '/www/src/client.js',
    react: ['react', 'react-dom', 'react-router']
  },
  output: {
    path: '/www/static',
    filename: '[name].bundle.js'
  },
  watchOptions: {
    poll: true // needed for watching in docker
  },
  plugins: isProduction
    ? commonPlugins.concat(productionPlugins)
    : commonPlugins,
  resolve: {
    extensions: ['', '.js']
  },
  postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        loaders: ['babel'],
        include: ['/www/src']
      },
      {
        test: /\.css$/,
        loader: ExtractTextPlugin.extract('style', 'css', 'postcss'),
        include: ['/www/src']
      }
    ]
  }
}

@@ -569,28 +569,24 @@
 hunkPlugin(%7B
-%0A   
  name: 'reac
@@ -591,43 +591,8 @@
 act'
-,%0A    filename: 'react.bundle.js'%0A 
  %7D),
@@ -648,47 +648,33 @@
 name
-s
 : 
-%5B''%5D
+'init'
 ,%0A    
-file
 name
+s
 : 
-'init.bundle.js'
+%5B''%5D
 ,%0A  
@@ -917,24 +917,46 @@
  false%0A    %7D
+,%0A    sourceMap: false
 %0A  %7D),%0A  new

Use names instead of filenames