Skip to content

Commit

Permalink
Fix this.serverless is undefined during zip
Browse files Browse the repository at this point in the history
Calling `serverlessZip` directly does not _inject_ (or hydrate) the `this` inside the `serverlessZip`.
We need to use `.call` for that.
  • Loading branch information
j0k3r committed May 10, 2022
1 parent 2f00f04 commit c34dbdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/packageModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function zip(directory, zipFileName) {
const artifactFilePath = path.join(this.webpackOutputPath, zipFileName);
this.serverless.utils.writeFileDir(artifactFilePath);

return serverlessZip({
return serverlessZip.call(this, {
directory,
artifactFilePath,
files
Expand Down

0 comments on commit c34dbdc

Please sign in to comment.