serverless-plugin-package-size

Check the size of your serverless functions

Usage no npm install needed!

<script type="module">
  import serverlessPluginPackageSize from 'https://cdn.skypack.dev/serverless-plugin-package-size';
</script>

README

serverless-plugin-package-size

Helps avoid accidentally deploying huge artifacts that are either slow to load, can't be debugged, etc.

cat serverless.yml

custom:
  packageLimit: '2mb'

This will fail if your package artifact exceeds 2mb. Supports whatever bytes-iec supports for the limit expression.