Commit 61ca496b authored by Mike Greiling's avatar Mike Greiling

optimize production output and generate sourcemaps

parent df72d65a
...@@ -22,6 +22,8 @@ var config = { ...@@ -22,6 +22,8 @@ var config = {
filename: IS_PRODUCTION ? '[name]-[chunkhash].js' : '[name].js' filename: IS_PRODUCTION ? '[name]-[chunkhash].js' : '[name].js'
}, },
devtool: 'source-map',
module: { module: {
loaders: [ loaders: [
{ {
...@@ -52,7 +54,19 @@ var config = { ...@@ -52,7 +54,19 @@ var config = {
} }
} }
if (!IS_PRODUCTION) { if (IS_PRODUCTION) {
config.plugins.push(
new webpack.NoErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') }
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
);
} else {
config.devServer = { config.devServer = {
port: DEV_SERVER_PORT, port: DEV_SERVER_PORT,
headers: { 'Access-Control-Allow-Origin': '*' } headers: { 'Access-Control-Allow-Origin': '*' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment