Skip to content

Commit 947c187

Browse files
committed
add hooks for serverless-offline support
1 parent c33a6b3 commit 947c187

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class RustPlugin {
3535
this.hooks = {
3636
"before:package:createDeploymentArtifacts": this.build.bind(this),
3737
"before:deploy:function:packageFunction": this.build.bind(this),
38+
"before:offline:start": this.build.bind(this),
39+
"before:offline:start:init": this.build.bind(this),
3840
};
3941
if (includeInvokeHook(serverless.version)) {
4042
this.hooks["before:invoke:local:invoke"] = this.build.bind(this);

tests/unit/index.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ describe("RustPlugin", () => {
2626
assert.deepEqual(Object.keys(plugin.hooks), [
2727
"before:package:createDeploymentArtifacts",
2828
"before:deploy:function:packageFunction",
29+
"before:offline:start",
30+
"before:offline:start:init",
2931
]);
3032
});
3133
it("sets sensible defaults", () => {

0 commit comments

Comments
 (0)