analyze_bundle_size
Analyze dependency bundle sizes to identify optimization opportunities and reduce application bloat in development projects.
Instructions
Analyze bundle size of dependencies
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | No | Path to project root |
Implementation Reference
- src/tools/dependency-analysis.ts:162-168 (handler)Handler for the 'analyze_bundle_size' tool: calls DependencyAnalyzer.analyzeBundleSize and formats the bundle size result for output.
case 'analyze_bundle_size': { const size = await analyzer.analyzeBundleSize(projectPath); return { bundleSize: size, formatted: size ? Formatters.formatBytes(size) : 'N/A', }; } - Input schema for 'analyze_bundle_size' tool defining the expected projectPath parameter.
inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to project root', }, }, }, - src/tools/dependency-analysis.ts:79-91 (registration)Registration of the 'analyze_bundle_size' tool in the dependencyAnalysisTools array.
{ name: 'analyze_bundle_size', description: 'Analyze bundle size of dependencies', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to project root', }, }, }, }, - Helper method in DependencyAnalyzer class implementing the bundle size analysis logic (currently stubbed).
async analyzeBundleSize(_projectPath: string): Promise<number | undefined> { // This is a simplified version. In production, we'd use bundle-phobia or webpack-bundle-analyzer // For now, return undefined return undefined; }