Skip to content

Commit 296224c

Browse files
committed
minify bundles on website. fixes #27.
1 parent 4b7d493 commit 296224c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

update-gh-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
echo "Regenerating bundle."
66

77
rm -rf *.bundle.*
8-
npm run bundle
8+
NODE_ENV=production npm run bundle
99

1010
echo "Cloning website into ./website/."
1111

webpack.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
var _ = require('underscore');
2+
var webpack = require('webpack');
3+
4+
var production = process.env.NODE_ENV === 'production';
25

36
var baseConfig = {
47
resolve: {
@@ -16,6 +19,16 @@ var baseConfig = {
1619
}
1720
]
1821
},
22+
plugins: [
23+
].concat(
24+
production ? [
25+
new webpack.optimize.UglifyJsPlugin({
26+
compress: {
27+
warnings: false
28+
}
29+
})
30+
] : []
31+
),
1932
postcss: function () {
2033
return [require('autoprefixer'), require('precss')];
2134
}

0 commit comments

Comments
 (0)