Currently, my TypeScript Lambda functions are managed using the AWS Serverless Application Model (SAM), and I rely on esbuild for the build process.
I'm interested in incorporating esbuild plugins into my build process to enable support for TypeScript Project References, allowing me to share code across multiple Lambda functions. However, I'm unsure about how to include these plugins directly in the template.yaml or if it's even feasible. Below is a snippet from my existing template.yaml:
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: esbuild
BuildProperties:
Minify: true
Target: es2020
# ... other properties
Is there a way to define esbuild plugins within the SAM template itself? If direct integration is not supported, what workarounds or best practices do you recommend for seamlessly integrating esbuild plugins with SAM?