Permalink
Browse files

Only minify in production

  • Loading branch information...
Benestar committed Mar 27, 2017
1 parent 9fcd403 commit 5c55362f9b8a8fc090202ac975e1024a38ddcade
Showing with 13 additions and 6 deletions.
  1. +13 −6 webpack.config.js
@@ -1,7 +1,18 @@
let path = require('path')
let webpack = require('webpack')
let ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
let OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');

let plugins = [
new ExtractTextPlugin('app.css')
]

if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin(),
new OptimizeCssAssetsPlugin()
)
}

module.exports = {
entry: [
@@ -36,9 +47,5 @@ module.exports = {
filename: 'app.js',
path: path.resolve(__dirname, 'static')
},
plugins: [
new ExtractTextPlugin('app.css'),
new webpack.optimize.UglifyJsPlugin(),
new OptimizeCssAssetsPlugin()
]
plugins
}

0 comments on commit 5c55362

Please sign in to comment.