Skip to content

Commit

Permalink
Apply webpack-bundle-analyzer to visualize generated bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
valscion committed Mar 19, 2017
1 parent 369cc69 commit fbbc306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var url = require('url');
var paths = require('./paths');
Expand Down Expand Up @@ -227,6 +228,11 @@ module.exports = {
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin(cssFilename),
// Generate a visualization of the built files to "report.html" file
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'report.html'
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "1.14.0",
"webpack-bundle-analyzer": "^2.3.1",
"webpack-dev-server": "1.16.2",
"webpack-manifest-plugin": "1.1.0",
"whatwg-fetch": "2.0.2"
Expand Down

0 comments on commit fbbc306

Please sign in to comment.