Skip to content

Commit ea9d96c

Browse files
committed
fix: watch files callback missing correct this context
After the refactor, I broke this by removing the bind in the hooks. Adding the bind to the callback function retains the this context while keeping the modularity of the hooks property. Fixes #162
1 parent c99fe30 commit ea9d96c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class TypeScriptPlugin {
131131
this.serverless.cli.log(`Watching typescript files...`)
132132

133133
this.isWatching = true
134-
watchFiles(this.rootFileNames, this.originalServicePath, this.compileTs)
134+
watchFiles(this.rootFileNames, this.originalServicePath, this.compileTs.bind(this))
135135
}
136136

137137
async compileTs(): Promise<string[]> {

0 commit comments

Comments
 (0)