From 947c187763f2b88e8d8acf7bb62666973c4519b9 Mon Sep 17 00:00:00 2001 From: softprops Date: Sat, 4 Jul 2020 20:27:44 -0400 Subject: [PATCH] add hooks for serverless-offline support --- index.js | 2 ++ tests/unit/index.test.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/index.js b/index.js index 0ac715a..e8e639e 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,8 @@ class RustPlugin { this.hooks = { "before:package:createDeploymentArtifacts": this.build.bind(this), "before:deploy:function:packageFunction": this.build.bind(this), + "before:offline:start": this.build.bind(this), + "before:offline:start:init": this.build.bind(this), }; if (includeInvokeHook(serverless.version)) { this.hooks["before:invoke:local:invoke"] = this.build.bind(this); diff --git a/tests/unit/index.test.js b/tests/unit/index.test.js index 42ae3f2..02fce94 100644 --- a/tests/unit/index.test.js +++ b/tests/unit/index.test.js @@ -26,6 +26,8 @@ describe("RustPlugin", () => { assert.deepEqual(Object.keys(plugin.hooks), [ "before:package:createDeploymentArtifacts", "before:deploy:function:packageFunction", + "before:offline:start", + "before:offline:start:init", ]); }); it("sets sensible defaults", () => {