- 최신
- 최다 투표
- 가장 많은 댓글
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.
관련 콘텐츠
- AWS 공식업데이트됨 10달 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 10달 전