 else
     plugins = plugins.concat(staticPages)
 
-BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
-bundleAnalyzerPlugin = new BundleAnalyzerPlugin({analyzerMode: 'static'})
-
-plugins = plugins.concat([assetsPlugin, statsWriterPlugin, bundleAnalyzerPlugin])
+if PRODMODE
+    # configuration for the number of chunks and their minimum size
+    plugins.push new webpack.optimize.LimitChunkCountPlugin(maxChunks: 5)
+
+plugins = plugins.concat([assetsPlugin, statsWriterPlugin])
 
 UglifyJsPlugin = require('uglifyjs-webpack-plugin')
 minimizer = new UglifyJsPlugin

console.log "CDN_BASE_URL     = #{CDN_BASE_URL}"
console.log "DEBUG            = #{DEBUG}"
console.log "MINIFY           = #{MINIFY}"
console.log "INPUT            = #{INPUT}"
console.log "OUTPUT           = #{OUTPUT}"
console.log "GOOGLE_ANALYTICS = #{GOOGLE_ANALYTICS}"

DEVMODE       = not PRODMODE
MINIFY        = !! process.env.WP_MINIFY
DEBUG         = '--debug' in process.argv
MEASURE       = process.env.MEASURE
SOURCE_MAP    = !! process.env.SOURCE_MAP
STATICPAGES   = !! process.env.CC_STATICPAGES  # special mode where just the landing page is built
date          = new Date()
