Vite Webpack Bundle Analyzer
Visualize size of Vite output files with an interactive zoomable treemap.
Install
NPM:
npm install --save-dev vite-webpack-bundle-analyzer
Yarn:
yarn add -D vite-webpack-bundle-analyzer
Usage
// vite.config.js
import { ViteWebpackBundleAnalyzer } from "vite-webpack-bundle-analyzer";
export default defineConfig({
plugins: [ViteWebpackBundleAnalyzer()],
})
Configuration
All config based by webpack-bundle-analyzer except:
- Temporally excluded
server
value from analyzerMode
and removed next related
options: analyzerHost
, analyzerPort
, analyzerUrl
.
- Overrides default value for defaultSizes:
parsed
-> stat
- Disabled bundle parsing by default because "webpack-bundle-analyzer" expected no module chunks. (For enabling default behavior set
enableBundleParsing: true
)