I’m trying to use Lambda Layers with Node.js and Typescript template. I added the Lambda Layer in serverless.yaml:
layers:
base:
path: src/layers/base
name: ${self:service}-${self:provider.stage}-base
compatibleRuntimes:
- nodejs
But the source code of the folder src/layers/base will not compiled from Typescript to Javascript. It will simply be uploaded as it is as Typescript code.
The folder contains only an index.ts file and two other .ts files, but no separate package.json.
Do I need to adapt my tsconfig or webpack config to compile TS to JS before uplaoding the layer?