Skip to content

chg: production webpack configuration should not point to webpack dev… #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions webpack/config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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,
Expand Down