Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Overall
score
98%
Build a tool that generates a secure HTML report from webpack bundle analysis data. The report must prevent common web security vulnerabilities while displaying bundle statistics.
@generates
Your tool should accept bundle analysis data (module names, sizes, and file paths) and generate a secure HTML report that visualizes this information.
The tool receives an array of modules, where each module contains:
name: Module name/path (may contain user-controlled content)size: Size in bytes (numeric)path: File path relative to project rootThe generated HTML report must be secure against:
<, >, ", etc.) that could inject malicious scriptseval() or similar unsafe JavaScript execution methodsGenerate a valid HTML file that:
<script>alert('xss')</script>, the report displays it as text without executing the script @test<, it is properly escaped in embedded JSON data @test../../../etc/passwd, it is validated and rejected or sanitized @test/**
* Generates a secure HTML report from bundle analysis data.
*
* @param {Array<{name: string, size: number, path: string}>} modules - Array of module data
* @param {Object} options - Report generation options
* @param {string} options.reportTitle - Title for the HTML report
* @param {string} options.outputPath - Where to write the HTML file
* @returns {Promise<string>} Path to the generated HTML file
*/
function generateSecureReport(modules, options) {
// Implementation here
}
module.exports = { generateSecureReport };Provides bundle analysis capabilities with built-in security features for report generation.
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