diff --git a/webpack/config.production.js b/webpack/config.production.js index 61eae83..1b9a2c5 100644 --- a/webpack/config.production.js +++ b/webpack/config.production.js @@ -3,8 +3,7 @@ var webpack = require('webpack'); var outputPath = 'dist/'; var port = process.env.PORT || 3001; var hostname = process.env.HOSTNAME || 'localhost'; -var host = 'http://' + hostname + ':' + port; -var assetHost = process.env.ASSET_HOST || host + '/' + outputPath; +var assetHost = process.env.ASSET_HOST || '/' + outputPath; var common = require('./config.common'); var baseUrl = '/'; var isoConfig = require('./config.isomorphic'); @@ -15,26 +14,28 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin'); var IsomorphicPlugin = require('webpack-isomorphic-tools/plugin'); module.exports = { - devServerPort: port, devtool: 'cheap-module-source-map', context: path.resolve(__dirname, '..'), entry: ['./client/index'], output: { path: path.join(__dirname, ('../' + outputPath)), - filename: 'bundle.js', + filename: '[name].[hash].js', publicPath: assetHost }, plugins: [ - new ExtractTextPlugin('styles.css'), + new webpack.optimize.DedupePlugin(), + new ExtractTextPlugin('[name].[hash].css'), new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en|es/), new IsomorphicPlugin(isoConfig), new webpack.optimize.UglifyJsPlugin({ compress: { - warnings: false + screw_ie8: true, + warnings: false, } }), + new webpack.optimize.AggressiveMergingPlugin(), new CompressionPlugin({ - asset: '{file}.gz', + asset: '[file].gz', algorithm: 'gzip', test: /\.css$|\.js$|\.html$/, threshold: 10240,