CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-5/

Bundle Analyzer with Selective Asset Analysis

A build tool that analyzes webpack bundles while excluding specific assets based on configurable patterns.

Requirements

Create a webpack configuration that integrates bundle analysis with the following filtering behavior:

Asset Exclusion Patterns

The analyzer should exclude assets matching any of these patterns:

  • Any files containing "vendor" in their name
  • Files matching the pattern *.legacy.js
  • Files in the "polyfills" directory (files with names like polyfills.123abc.js)

Analysis Output

  • Generate a static HTML report saved to dist/bundle-report.html
  • Use parsed sizes as the default size metric in the report
  • The report should not auto-open in a browser
  • Set logging to warn level to reduce console output

Test Cases

  • When analyzing a bundle with files main.js, vendor.bundle.js, app.legacy.js, and polyfills.abc123.js, only main.js should appear in the analysis report @test
  • The generated report file should exist at dist/bundle-report.html @test

Implementation

@generates

API

// Export a webpack configuration object that includes the bundle analyzer plugin
// with appropriate filtering and output options
module.exports = {
  // webpack configuration here
};

Dependencies { .dependencies }

webpack-bundle-analyzer { .dependency }

Provides bundle size analysis and visualization capabilities.

Install with Tessl CLI

npx tessl i tessl/npm-webpack-bundle-analyzer

tile.json