File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ declare namespace Serverless {
15
15
functions : {
16
16
[ key : string ] : Serverless . Function
17
17
}
18
+ layers : { [ key : string ] : Serverless . Layer }
18
19
package : Serverless . Package
19
20
getAllFunctions ( ) : string [ ]
21
+ getAllLayers ( ) : string [ ]
20
22
custom ?: {
21
23
serverlessPluginTypescript ?: {
22
24
tsConfigFileLocation : string
@@ -38,6 +40,11 @@ declare namespace Serverless {
38
40
package : Serverless . Package
39
41
}
40
42
43
+ interface Layer {
44
+ handler : string
45
+ package : Serverless . Package
46
+ }
47
+
41
48
interface Package {
42
49
include : string [ ]
43
50
exclude : string [ ]
Original file line number Diff line number Diff line change @@ -250,6 +250,15 @@ export class TypeScriptPlugin {
250
250
path . join ( this . originalServicePath , SERVERLESS_FOLDER )
251
251
)
252
252
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
+
253
262
if ( this . options . function ) {
254
263
const fn = service . functions [ this . options . function ]
255
264
fn . package . artifact = path . join (
You can’t perform that action at this time.
0 commit comments