- Le plus récent
- Le plus de votes
- La plupart des commentaires
I worked on this problem for quite a while. Cloudfront Functions are definitely meant to be small. It is all explained reasonably well HERE. The javascript that runs a cloud function is pretty limited not only in what it can do but also the language - for example there's no const or let. It's kind of close to ECMAScript 5.1 with a bunch of stuff missing.
Based on this, I don't know how you'd coerce the typescript compiler to build to that. See HERE. I am not confident you could make it work, and if even if you sort of did I think you'd run into many unpleasant surprises.
In my case, I only really cared about having strong typing, for reasons of code quality. But with the idea that Cloudfront Functions are meant to be short and sweet, I decided to just do without it, and that's what I recommend you do, too. If you need more, run lambda@edge instead. Just keep in mind that costs six times as much per invocation, meaning if you can do it in a Cloudfront Function that's definitely advisable. All I'm saying is that CloudFront Functions are meant to be pretty to-the-point, so maybe you need to convince yourself you can live without it being in TS.
This question has been sitting out here for quite a while, so I'm probably too late. Hope this helps somebody else, though.
Contenus pertinents
- demandé il y a 9 mois
- demandé il y a un an
- demandé il y a 7 mois
- Réponse acceptéedemandé il y a 8 mois
- AWS OFFICIELA mis à jour il y a 9 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 10 mois
- AWS OFFICIELA mis à jour il y a 2 ans