title: Delete unused webpack chunked files
body: <p>I'm looking for information on how to delete old webpack chunked files. Here is my current webpack configuration:</p>
  
  <pre><code>var path = require('path');
  var webpack = require('webpack');
  
  module.exports = {
    debug: false,
    outputPathinfo: true,
    displayErrorDetails: true,
    context: __dirname,
    entry: {
      common: ['./src/common.coffee'],
      a: './src/a.cjsx',
      b: './src/b.cjsx'
    },
    output: {
      filename: '[name]-[chunkhash].js',
      chunkFileName: '[name].[chunkhash].js',
      path: path.join(__dirname, 'js')
    },
    plugins: [
      new webpack.optimize.CommonsChunkPlugin('common', 'common-[chunkhash].js'),
      new webpack.optimize.UglifyJsPlugin({
        compress: { warnings: false }
      })
    ],
    module: {
      preLoaders: [
        {
          test: /\.coffee$/,
          exclude: /node_modules/,
          loader: 'coffeelint-loader'
        }
      ],
      loaders: [
        { test: /\.coffee/, loader: 'coffee' },
        { test: /\.cjsx$/, loaders: ['coffee', 'cjsx'] },
        { test: /\.js$/, loader: 'jsx-loader?harmony' }
      ]
    }
  }
  </code></pre>
  
  <p>If I am running <code>$(npm bin)/webpack --config webpack.js --watch</code> and make changes to <code>a.cjsx</code>, it compiles a newer version of that file with a new chunkedhash. However, the old one remains and I'd like it to be deleted right away.</p>
  
  <ol>
  <li>How can I delete the old version of the chunked file?</li>
  <li>Is there a way for me to hook into an after callback once watch finishes compiling?</li>
  </ol>