Typescript support
sevenseat opened this issue · 2 comments
sevenseat commented
It would be great if this plugin would/could support typescript. Webpack can easily handle that with the ts-loader
. However I've found two issues so-far with this typescript within serverless-plugin-webpack
:
lib/service.js/fnPath
hardcodes the.js
extensionindex.js/webpackDefaultOutput
outputs a bundle with the same name as the handler.... In the case of a typescript handler, it would be something likehandler.ts
.... But running the function then fails, as lambda needs a.js
file
I'm happy to attempt a patch.... However, I believe it will require some configuration within serverless.yaml
. Would you be open to that?
sevenseat commented
FYI... I just implemented a simple workaround.... A javascript entry-point that delegates to a ts handler. It works perfectly. Here's the code:`
'use strict';
const delegate = require('./handler-delegated');
module.exports = delegate;
jogold commented
Thank you @JnJSW, will close this for now.