Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade to webpack 2.2.0-rc.3 (decidim#468)
* Upgrade to webpack-2.2.0-rc.3

* Add webpack bundle analyzer

* Disable webpack bundle analyzer for test
  • Loading branch information
beagleknight authored and josepjaume committed Jan 10, 2017
1 parent f1f2c1d commit b4b76dd
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ npm-debug.log
karma-*
yarn-error.log
coverage
webpack.report.html
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -53,7 +53,8 @@
"react-addons-test-utils": "^15.4.0",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"webpack": "2.1.0-beta.27",
"webpack": "2.2.0-rc.3",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-config-utils": "^2.3.0",
"webpack-validator": "^2.2.12",
"yaml-loader": "^0.4.0"
Expand Down
17 changes: 12 additions & 5 deletions webpack.config.js
@@ -1,12 +1,14 @@
const webpack = require('webpack');
const webpackValidator = require('webpack-validator');
const webpackConfigUtils = require('webpack-config-utils');
const getIfUtils = webpackConfigUtils.getIfUtils;
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const webpack = require('webpack');
const webpackValidator = require('webpack-validator');
const webpackConfigUtils = require('webpack-config-utils');
const getIfUtils = webpackConfigUtils.getIfUtils;
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = env => {
const envUtils = getIfUtils(env);
const ifProd = envUtils.ifProd;
const ifTest = envUtils.ifTest;

const config = webpackValidator({
entry: {
Expand Down Expand Up @@ -62,6 +64,11 @@ module.exports = env => {
'process.env': {
NODE_ENV: ifProd('"production"', '"development"')
}
}),
new BundleAnalyzerPlugin({
analyzerMode: ifTest('disabled', 'static'),
reportFilename: 'webpack.report.html',
openAnalyzer: false
})
],
externals: {
Expand Down

0 comments on commit b4b76dd

Please sign in to comment.