dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 40 forks source link

Bug: getHandlerFilename lastIndexOf #33

Closed vbryan closed 3 years ago

vbryan commented 5 years ago

There's bug for google cloud functions. Example: serverless.yml: functions: exportProduct: handler: exportProduct

getHandlerFilename(hanlder) returns exportProduc

Possible solution: getHandlerFilename(handler) { const lastDotIndex = handler.lastIndexOf('.'); const handlerPath = handler.slice(0, lastDotIndex !== -1 ? lastDotIndex : 0); return require.resolve((path.join(this.serverless.config.servicePath, handlerPath))); }

dougmoscrop commented 5 years ago

I don't use GCP but if you can contribute a fix I would happily merge this

aychtang commented 3 years ago

@dougmoscrop I think we can close this due to #55

dougmoscrop commented 3 years ago

Sounds good, feel free to reopen if needed!