File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,9 @@ export class TypeScriptPlugin {
6666 } )
6767 }
6868 } ,
69- 'after:invoke:local:invoke' : ( ) => {
69+ 'after:invoke:local:invoke' : async ( ) => {
7070 if ( this . options . watch ) {
71- this . watchFunction ( )
72- this . serverless . cli . log ( 'Waiting for changes...' )
71+ await this . watchFunction ( )
7372 }
7473 }
7574 }
@@ -117,10 +116,13 @@ export class TypeScriptPlugin {
117116 }
118117
119118 this . serverless . cli . log ( `Watch function ${ this . options . function } ...` )
119+ this . serverless . cli . log ( 'Waiting for changes...' )
120120
121121 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+ } )
124126 } )
125127 }
126128
You can’t perform that action at this time.
0 commit comments