Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Overall
score
98%
Create a utility that configures webpack-bundle-analyzer to generate customized bundle analysis reports for different deployment environments.
Your task is to implement a configuration generator that creates webpack-bundle-analyzer plugin instances with customized report settings based on the deployment environment.
The utility should export a function createAnalyzerConfig(environment) that accepts an environment name and returns a configured BundleAnalyzerPlugin instance.
For "production" environment:
For "staging" environment:
For "development" environment:
For any other environment:
@generates
/**
* Creates a configured webpack-bundle-analyzer plugin instance for the specified environment.
*
* @param {string} environment - The deployment environment ('production', 'staging', or 'development')
* @returns {BundleAnalyzerPlugin} Configured plugin instance
* @throws {Error} If environment is not supported
*/
function createAnalyzerConfig(environment) {
// IMPLEMENTATION HERE
}
module.exports = { createAnalyzerConfig };Provides bundle analysis and visualization capabilities.
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