Currently the plugin does not take into account the working directory configured by webpack's "context" property value (i.e. in the webpack.config.js file), when searching for the serverless.yml handler functions (i.e. auto detection of handler functions is triggered by configuring webpack's "entry" to slsw.lib.entries ).
USE CASE
You have a valid reason to split your serverless API projects up into many.
Some example reasons for why one might want to split up there existing serverless API projects into
separate serverless projects are as below:
a.) Overcome CloudFormation template resource limits, but want to use the Shared API Gateway
feature of the serverless framework.
b.) A need to separate out end points into separate API gateways
c.) Logic grouping of end points for better maintenance, CI or dev workflow scenarios
You want to reference function handles from a shared code base in some parent directory that exists
outside of the serverless project directory
PROPOSED IMPLEMENTATION
In my view this feature could be easily implemented using by allowing the end user to add the "context" webpack config property to the webpack.config.js file, and then the serverless-webpack plugin uses that value as the working directory when searching for the function handler modules.
This would allow you to have multiple services with functions handlers that reference the same centralized code base which may exist outside of each serverless project directory.
This is a Feature Proposal ...
Description
Currently the plugin does not take into account the working directory configured by webpack's "context" property value (i.e. in the webpack.config.js file), when searching for the serverless.yml handler functions (i.e. auto detection of handler functions is triggered by configuring webpack's "entry" to slsw.lib.entries ).
USE CASE
PROPOSED IMPLEMENTATION In my view this feature could be easily implemented using by allowing the end user to add the "context" webpack config property to the webpack.config.js file, and then the serverless-webpack plugin uses that value as the working directory when searching for the function handler modules.
This would allow you to have multiple services with functions handlers that reference the same centralized code base which may exist outside of each serverless project directory.
Sample structure
-srcRoot
Similar or dependent issue(s): Couldn't find any matching exact same use case in this repo.
Additional Data