Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Overall
score
98%
You are working on a webpack-based web application that has grown significantly in size. Your team needs to understand what's inside the production bundles to identify opportunities for optimization. Your task is to set up bundle size visualization that generates an interactive HTML report.
Configure your webpack build to automatically analyze bundle composition after each production build. The analysis should:
bundle-report.html in the project root directoryNODE_ENV=production)npm run build with NODE_ENV=production generates a bundle-report.html file in the project root @testbundle-report.html file is a valid HTML file containing visualization data @testnpm run build with NODE_ENV=development does NOT generate the bundle report @test@generates
Your webpack configuration should export a function that receives environment variables and returns the appropriate webpack configuration object.
module.exports = (env) => {
// Return webpack configuration object
return {
// webpack configuration
};
};Provides module bundling capabilities.
Provides bundle size visualization and analysis.
Install with Tessl CLI
npx tessl i tessl/npm-webpack-bundle-analyzerevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10