Webpack Bundle Analyzer
by John Vincent
Posted on October 19, 2018
This stuff ends up sprayed everywhere, so let's create a reference document.
Webpack Bundle Analyzer
Install
npm i --save-dev webpack-bundle-analyzer
Usage
Add to package.json scripts
"statistics": "webpack --mode development --profile --json > statistics.json && webpack-bundle-analyzer statistics.json dist"
"production-statistics": "rm -rf dist && NODE_ENV=production webpack --mode production --profile --json > production-statistics.json && webpack-bundle-analyzer production-statistics.json dist",
which creates files statistics.json
for development mode and production-statistics.json
for production mode. These files are used to create the analysis in a separate browser window.
These files can be very large. Thus add them to .gitignore
Webpack Visualizer
Open in a browser
https://chrisbateman.github.io/webpack-visualizer/
Drag and drop the statistics json file and a graph will be produced showing usage by module.
Webpack Analyzer
Open in a browser
https://webpack.github.io/analyse/
Load the statistics json file and the analysis is performed.
React
- Basic React
- Basic React Patterns
- Basic React Redux
- Basic React Redux App
- Basic React Testing with Jest and Enzyme
- Building and deploying MyTunes to johnvincent.io
- Building and deploying React Github Helper App to johnvincent.io
- Deploy React App to Heroku using Travis Continuous Integration
- Deploy TaskMuncher React App to AWS
- First time deploy TaskMuncher React App to Digital Ocean
- Gatsby and Client Only Components
- Gatsby Getting Started
- Gatsby React Icons
- Mac Visual Studio Code
- Material-UI
- Material-UI Pickers
- Material-UI Styling
- Optimizing TaskMuncher with Webpack 4
- Overview of React Gomoku
- Overview of React Hangman
- Overview of React Lights Out
- Overview of React Yahtzee
- React Material-UI
- React Production Issues
- React PropTypes
- React/Redux Node/Express Ecosystem
- Redux Dev Tools
- Responsive Material-UI
- Styling Material-UI components using Styled-Components
- TaskMuncher Performance
- Transforming Html with Webpack
- Update TaskMuncher for Lighthouse Findings
- Update TaskMuncher to be a Progressive Web App
- Update TaskMuncher to use React BrowserRouter
- Update TaskMuncher to Webpack v4, Babel v7, Material-UI v3
- Upgrading Babel and ESLint to use React Advanced Language Features
- Webpack Bundle Analyzer