diff --git a/README.md b/README.md index 2a3d40fc..2415607b 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,21 @@ plugin as follows: Run `serverless offline start`. +#### serverless-plugin-simulate + +Add the plugins to your `serverless.yml` file and make sure that `serverless-plugin-typescript` +precedes `serverless-plugin-simulate` as the order is important: +```yaml + plugins: + ... + - serverless-plugin-typescript + ... + - serverless-simulate-simulate + ... +``` + +`serverless-plugin-typescript` attaches to `simulate lambda` and `simulate apigateway` events + #### Other useful options You can reduce the clutter generated by `serverless-offline` with `--dontPrintOutput` and diff --git a/src/index.ts b/src/index.ts index f89a891c..863362af 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,6 +39,8 @@ export class TypeScriptPlugin { await this.compileTs() this.watchAll() }, + 'before:simulate:lambda:start': this.compileTs.bind(this), + 'before:simulate:apigateway:initialize': this.compileTs.bind(this), 'before:package:createDeploymentArtifacts': this.compileTs.bind(this), 'after:package:createDeploymentArtifacts': this.cleanup.bind(this), 'before:deploy:function:packageFunction': this.compileTs.bind(this),