serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't use the new slsw.lib.entries with typescript

kikar opened this issue · comments

commented

This is a Bug Report

Description

slsw.lib.entries returns an object with keys name.js, and as values the string ./name.js.
This is making developing with typescript quite difficult:

  1. The key shouldn't have an extension in case i'm using an output name like [name].[hash].js, or in case I actually want a different extension.
  2. The value should't have an extension as well, so I can actually input typescript files

Additional Data

  • Serverless-Webpack Version you're using: 2.1.0

The values are the actual handler files that are the entry points defined by your service, which are determined by the Serverless service. I agree that, if you have a TS handler, it should point to the ts file and should not stupidly append .js to the handler base file name, but check for the file itself and set the correct path to the actual file (ts, js or something else) as value. This should be done automatically by the plugin.

The keys should behave the same -> if you are using ts the key should end with ts. As a user you know what your service configuration is, so it will then be quite easy to replace it via regex if you want a non-standard special behavior.

After some thinking, the keys should not add the extension, because of the filename modification you mentioned above.

commented

👍🏻 Going to edit my pull request

commented

@HyperBrain opened a PR, could you help me with the documentation?