The variable this.config is initialized when the package:initialize hook is called, then this.config is referenced during the deployment phase when transformLayerResources is called.
If the package and deploy phases are broken into two steps, for example with this workflow:
serverless package --stage test --package sls-package-outputserverless deploy -v --stage test --package sls-package-output
Hello,
The variable
this.config
is initialized when thepackage:initialize
hook is called, thenthis.config
is referenced during the deployment phase whentransformLayerResources
is called.If the
package
anddeploy
phases are broken into two steps, for example with this workflow:serverless package --stage test --package sls-package-output
serverless deploy -v --stage test --package sls-package-output
Then
this.config
isnull
when the deployment phase is run andtransformLayerResources
breaks when trying to destructure the vars on line 97 (https://github.com/henhal/serverless-plugin-layer-manager/blob/accf6e6094711c3c5f2fdbbdb95b74c9e654688f/LayerManagerPlugin.js#L97)This pull request just grabs the
DEFAULT_CONFIG
ifthis.config
is null.