File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ declare namespace Serverless {
1515 functions : {
1616 [ key : string ] : Serverless . Function
1717 }
18+ layers : { [ key : string ] : Serverless . Layer }
1819 package : Serverless . Package
1920 getAllFunctions ( ) : string [ ]
21+ getAllLayers ( ) : string [ ]
2022 custom ?: {
2123 serverlessPluginTypescript ?: {
2224 tsConfigFileLocation : string
@@ -38,6 +40,11 @@ declare namespace Serverless {
3840 package : Serverless . Package
3941 }
4042
43+ interface Layer {
44+ handler : string
45+ package : Serverless . Package
46+ }
47+
4148 interface Package {
4249 include : string [ ]
4350 exclude : string [ ]
Original file line number Diff line number Diff line change @@ -250,6 +250,15 @@ export class TypeScriptPlugin {
250250 path . join ( this . originalServicePath , SERVERLESS_FOLDER )
251251 )
252252
253+ const layerNames = service . getAllLayers ( )
254+ layerNames . forEach ( name => {
255+ service . layers [ name ] . package . artifact = path . join (
256+ this . originalServicePath ,
257+ SERVERLESS_FOLDER ,
258+ path . basename ( service . layers [ name ] . package . artifact )
259+ )
260+ } )
261+
253262 if ( this . options . function ) {
254263 const fn = service . functions [ this . options . function ]
255264 fn . package . artifact = path . join (
You can’t perform that action at this time.
0 commit comments