Skip to content

Commit

Permalink
feat: analyze fronted build
Browse files Browse the repository at this point in the history
  • Loading branch information
杨国璇 authored and 杨国璇 committed Oct 12, 2024
1 parent 747fd7d commit c6210d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const modules = require('./modules');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const webpackBundleTracker = require('webpack-bundle-tracker');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const ForkTsCheckerWebpackPlugin =
process.env.TSC_COMPILE_ON_ERROR === 'true'
Expand Down Expand Up @@ -317,6 +318,7 @@ module.exports = function (webpackEnv) {
runtimeChunk: {
name: 'runtime',
},
concatenateModules: false,
},
resolve: {
// This allows you to set a fallback for where webpack should look for modules.
Expand Down Expand Up @@ -807,6 +809,7 @@ module.exports = function (webpackEnv) {
filename: isEnvProduction ? './webpack-stats.pro.json' : './webpack-stats.dev.json',
publicPath: isEnvProduction ? '' : paths.publicUrlOrPath
}),
new BundleAnalyzerPlugin(),
].filter(Boolean),
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
"url-loader": "4.1.1",
"web-vitals": "2.1.4",
"webpack": "^5.64.4",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-bundle-tracker": "1.7.0",
"webpack-dev-server": "^4.6.0",
"webpack-manifest-plugin": "^4.0.2",
Expand Down

0 comments on commit c6210d1

Please sign in to comment.