Vite plugin that simplifies building AWS Lambda functions by configuring Vite for library mode: defaults output to ES modules with .mjs extension, externalizes all Node.js built-in modules, and optionally zips the output directory into a Lambda-ready deployment package. Current version 1.0.4 requires Vite >=5.2.7. Key differentiators: zero-config setup for Vite users, handles common Lambda packaging tasks (externalization, zip) automatically, and ships TypeScript types. Release cadence appears low; no major breaking changes documented yet.
npm install vite-plugin-aws-lambdaVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config integrating the plugin with a library entry for AWS Lambda deployment.
Ensure lambda() is the last item in the plugins array.
Use absolute or outDir-relative paths for outFilename.
Upgrade Vite to >=5.2.7 or use an older version of the plugin (if available).
Review changelog before upgrading.
Set build.lib.entry in your Vite config.
Use default import: import lambda from 'vite-plugin-aws-lambda'.
Run npm install vite-plugin-aws-lambda --save-dev.