Serverless analyze bundle plugin

January 29, 2023 ยท View on GitHub

A Serverless plugin to analyze the bundle of a lambda function.

Prerequisites ๐Ÿ““

  1. Use serverless-esbuild to bundle your functions
  2. Only individually bundled functions can be analyzed

Usage ๐Ÿ“ฆ

Install with

pnpm add -D serverless-analyze-bundle-plugin

Add serverless-analyze-bundle-plugin to your serverless plugins.

Run the following command to analyze a function:

serverless package --analyze myFunctionName

Options ๐Ÿ› 

--analyze

The name of the function to analyze.

--template

The bundle template to use. Should be one of sunburst, treemap, network. Defaults to treemap.

Using the CDK instead of the Serverless Framework? ๐Ÿค”

No worries! Check out my library cdk-bundle-analyzer that does the same thing for the CDK ๐Ÿš€