Skip to content

Commit

Permalink
Add bundle report (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic16x authored Nov 29, 2024
1 parent 21e7bd9 commit 3dfc132
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ node_modules/
/storybook-static

*storybook.log
report.html
142 changes: 142 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"webpack": "^5.96.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-hot-middleware": "^2.26.1",
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const outputPath = path.resolve(__dirname, `./dist`);
Expand Down Expand Up @@ -75,6 +77,11 @@ module.exports = {
]
},
plugins: [
new BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static',
reportFilename: path.resolve(__dirname, 'report.html'),
}),
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(srcPath, 'index.html.ejs'),
Expand Down

0 comments on commit 3dfc132

Please sign in to comment.