Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Overall
score
98%
Build a Node.js module that provides a configurable wrapper around webpack bundle analysis with flexible logging control for different environments.
Your module should provide a function that analyzes webpack bundles with configurable verbosity. The function should support different execution contexts (development, CI/CD, production) that require different amounts of console output.
Support four verbosity levels:
info: Show detailed information about the analysis process, including server URLs, file paths, and progress updateswarn: Show only warnings about potential issues and errorserror: Show only critical errors that prevent analysissilent: Suppress all console outputThe verbosity level should be configurable when calling the analysis function.
Support two analysis modes:
The wrapper should:
info level, the server URL should be displayedsilent level, no output should appearinfo level, the output file path should be displayed@generates
/**
* Analyzes a webpack stats file with configurable logging
* @param {string} statsFilePath - Path to the webpack stats JSON file
* @param {object} options - Configuration options
* @param {string} options.mode - Analysis mode: 'server' or 'static'
* @param {string} options.logLevel - Verbosity level: 'info', 'warn', 'error', or 'silent'
* @param {string} [options.reportFilename] - Output filename for static reports (default: 'report.html')
* @param {number} [options.port] - Port for server mode (default: 8888)
* @returns {Promise<object>} Object containing report location info
*/
async function analyzeBundleWithLogging(statsFilePath, options) {
// Implementation
}
module.exports = { analyzeBundleWithLogging };Provides bundle analysis capabilities and logging utilities for webpack stats files.
@satisfied-by
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