Skip to content

Commit 2bd41e3

Browse files
authored
Merge pull request #10 from hartym/master
chg: production webpack configuration should not point to webpack dev…
2 parents d3e09d4 + c252257 commit 2bd41e3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

webpack/config.production.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ var webpack = require('webpack');
33
var outputPath = 'dist/';
44
var port = process.env.PORT || 3001;
55
var hostname = process.env.HOSTNAME || 'localhost';
6-
var host = 'http://' + hostname + ':' + port;
7-
var assetHost = process.env.ASSET_HOST || host + '/' + outputPath;
6+
var assetHost = process.env.ASSET_HOST || '/' + outputPath;
87
var common = require('./config.common');
98
var baseUrl = '/';
109
var isoConfig = require('./config.isomorphic');
@@ -15,24 +14,26 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
1514
var IsomorphicPlugin = require('webpack-isomorphic-tools/plugin');
1615

1716
module.exports = {
18-
devServerPort: port,
1917
devtool: 'cheap-module-source-map',
2018
context: path.resolve(__dirname, '..'),
2119
entry: ['./client/index'],
2220
output: {
2321
path: path.join(__dirname, ('../' + outputPath)),
24-
filename: 'bundle.js',
22+
filename: '[name].[hash].js',
2523
publicPath: assetHost
2624
},
2725
plugins: [
28-
new ExtractTextPlugin('styles.css'),
26+
new webpack.optimize.DedupePlugin(),
27+
new ExtractTextPlugin('[name].[hash].css'),
2928
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en|es/),
3029
new IsomorphicPlugin(isoConfig),
3130
new webpack.optimize.UglifyJsPlugin({
3231
compress: {
33-
warnings: false
32+
screw_ie8: true,
33+
warnings: false,
3434
}
3535
}),
36+
new webpack.optimize.AggressiveMergingPlugin(),
3637
new CompressionPlugin({
3738
asset: '[file].gz',
3839
algorithm: 'gzip',

0 commit comments

Comments
 (0)