Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Overall
score
98%
Create a utility that analyzes webpack bundle files to extract module size information and generate a summary report.
Your task is to build a command-line tool that:
Accepts a webpack stats file path as a command-line argument
Analyzes the bundle data to extract module information
Generates a JSON report containing:
Writes the report to a file named bundle-report.json in the current directory
The tool will receive a path to a webpack stats JSON file as the first command-line argument:
node src/analyzer.js path/to/stats.jsonThe output file bundle-report.json should have this structure:
{
"totalModules": 150,
"totalBundleSize": 524288,
"chunkNames": ["main", "vendor", "runtime"],
"largestModules": [
{
"name": "./node_modules/some-library/index.js",
"size": 45000
},
{
"name": "./src/components/LargeComponent.js",
"size": 32000
}
]
}@generates
Provides bundle analysis and parsing capabilities.
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