From e0b4516f2046039ecadefbfd1c248069230c01cf Mon Sep 17 00:00:00 2001 From: Richard Miles Date: Sun, 29 Aug 2021 16:54:02 +0200 Subject: [PATCH] feat: added support for custom build directory --- README.md | 1 + index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e05684f..ef90091 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ plugins: custom: stepFunctionsOffline: + # location: .build - Optional if the location of your handler.js is not in ./ (useful for typescript) FirstLambda: firstLambda #(v2.0) # ... # ... diff --git a/index.js b/index.js index 0f46766..f0ffa2b 100644 --- a/index.js +++ b/index.js @@ -6,9 +6,9 @@ const path = require('path'); class StepFunctionsOfflinePlugin { constructor(serverless, options) { - this.location = process.cwd(); this.serverless = serverless; this.options = options; + this.location = this.options.location || process.cwd(); this.stateMachine = this.options.stateMachine; this.detailedLog = this.options.detailedLog || this.options.l; this.eventFile = this.options.event || this.options.e;