File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,9 @@ export class TypeScriptPlugin {
66
66
} )
67
67
}
68
68
} ,
69
- 'after:invoke:local:invoke' : ( ) => {
69
+ 'after:invoke:local:invoke' : async ( ) => {
70
70
if ( this . options . watch ) {
71
- this . watchFunction ( )
72
- this . serverless . cli . log ( 'Waiting for changes...' )
71
+ await this . watchFunction ( )
73
72
}
74
73
}
75
74
}
@@ -117,10 +116,13 @@ export class TypeScriptPlugin {
117
116
}
118
117
119
118
this . serverless . cli . log ( `Watch function ${ this . options . function } ...` )
119
+ this . serverless . cli . log ( 'Waiting for changes...' )
120
120
121
121
this . isWatching = true
122
- watchFiles ( this . rootFileNames , this . originalServicePath , ( ) => {
123
- this . serverless . pluginManager . spawn ( 'invoke:local' )
122
+ await new Promise ( ( resolve , reject ) => {
123
+ watchFiles ( this . rootFileNames , this . originalServicePath , ( ) => {
124
+ this . serverless . pluginManager . spawn ( 'invoke:local' ) . catch ( reject )
125
+ } )
124
126
} )
125
127
}
126
128
You can’t perform that action at this time.
0 commit comments