support TypeScript for backend functions
See original GitHub issueIs your feature request related to a problem? Please describe.
I use the TypeScript generation features for my front-end client, but am frustrated that any of the Lambda functions I create via amplify add api or amplify add function must be written in vanilla JavaScript. This also makes it very difficult to share code between the backend and frontend (note that many of the auto-generated files created by amplify cli use syntax like export default blah that is invalid for use in the backend files).
Describe the solution you’d like
Switch to using tsc to compile the files found in amplify/backend/function/*/src/ so that we can opt-in to type-safety by changing our file extension from .js to .ts or .tsx, similar to how Create React App has handled this in version 2.0.0+.
Describe alternatives you’ve considered
Alternatively, add (or document) how we can hook into the build process for amplify/backend/function/* so we can inject a TypeScript transpilation step ourselves.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:138
- Comments:36 (8 by maintainers)

Top Related StackOverflow Question
Really want this feature. I know I’m not adding much to the conversation but there needs to be options within the cli to scaffold typescript outputs for all aspects of an amplify solution.
I’m actually against adding this functionality until Typescript is supported natively by AWS Lambda- hear me out…
The ideal scenario would be that typescript would be pushed up as is.
We’d then get type support directly inside the Lambda editor on the AWS Console.
It would also really suck to have Amplify spend time on this to then see Typescript support pop up in AWS Lambda.