CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-rollup-plugin-sizes

Show info about files/packages included with your rollup bundle

94

1.09x
Overview
Eval results
Files

task.mdevals/scenario-3/

Bundle Size Analyzer

Build a simple Rollup build configuration that analyzes and reports the size composition of a bundle.

Requirements

Your implementation should:

  1. Create a Rollup configuration that bundles JavaScript files
  2. Integrate bundle size analysis to show which packages and modules contribute to the total bundle size
  3. Output a size report to the console showing package names, their sizes, and percentages of the total bundle
  4. Support analyzing bundles with multiple npm dependencies

Implementation

@generates

API

// Export a Rollup configuration object that:
// - Takes an input file as the entry point
// - Outputs to a specified directory
// - Includes size analysis reporting
export default {
  // Rollup configuration here
};

Test Cases

Basic Bundle Analysis

  • Given a bundle with a single npm dependency, the size report displays the dependency name, its size in human-readable format, and its percentage of the total bundle @test
  • Given a bundle with application code and npm dependencies, the size report correctly categorizes and displays both "app" code and package sizes separately @test
  • Given a bundle with multiple npm dependencies, the size report lists all packages sorted by size in descending order @test

Dependencies { .dependencies }

rollup { .dependency }

Provides JavaScript module bundling functionality.

rollup-plugin-sizes { .dependency }

Provides bundle size analysis and reporting capabilities.

Install with Tessl CLI

npx tessl i tessl/npm-rollup-plugin-sizes

tile.json