Show info about files/packages included with your rollup bundle
94
{
"context": "This criteria evaluates the engineer's ability to use rollup-plugin-sizes custom report functions to export bundle size data to a JSON file. The focus is on correct usage of the plugin's report option and proper handling of the data structure provided by the plugin.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Plugin import",
"description": "Correctly imports the rollup-plugin-sizes package (e.g., import sizes from 'rollup-plugin-sizes' or require('rollup-plugin-sizes'))",
"max_score": 10
},
{
"name": "Plugin configuration",
"description": "Adds the sizes plugin to the Rollup plugins array with proper invocation (e.g., sizes({...}) in the plugins array)",
"max_score": 15
},
{
"name": "Report option usage",
"description": "Uses the 'report' option to provide a custom report function (e.g., sizes({ report: (data) => {...} }))",
"max_score": 25
},
{
"name": "Data structure access",
"description": "Correctly accesses the 'totals' array from the data object provided to the report function, which contains package summaries with name and size",
"max_score": 20
},
{
"name": "Package data extraction",
"description": "Properly extracts package name and size from the totals array entries (e.g., accessing .name and .size properties from each total object)",
"max_score": 15
},
{
"name": "Total size usage",
"description": "Uses the 'total' property from the data object to calculate percentages (e.g., data.total for the total bundle size in bytes)",
"max_score": 10
},
{
"name": "JSON file output",
"description": "Writes the processed bundle size data to 'bundle-report.json' file using appropriate file system operations (e.g., fs.writeFileSync or fs.promises.writeFile)",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-rollup-plugin-sizesdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10