For the past few days I was working on Lambda Function that programmatically generates thumbnails for social media from URL. Also, I really want to dive in TypeScript more, so this was great opportunity to test the water with small project. Setting up TypeScript for Lambda was surprisingly easy thanks to this serverless plugin.
To start, as expected, you need to add plugin and typescript as dev dependencies.
yarn add -D serverless-plugin-typescript typescript
And latter, you need to add plugin to
That's it! TypeScript is now working in your project. You just need to configure it with
tsconfig.json. These are defaults that plugin uses.
Worth noting is that
serverless-plugin-typescript works great with
serverless-offline and similar plugins.