Skip to content

Commit

Permalink
Update conditional block for package inclusion in index.js (#40)
Browse files Browse the repository at this point in the history
This change ensures the inclusion of a package only when it exists and has the 'include' property. Before, the logic would throw an error when the function's package property exists but doesn't have the 'include' property.
  • Loading branch information
danprueitt authored Aug 24, 2023
1 parent 18ff6a3 commit 486816c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ module.exports = class Plugin {
this.serverless.service.functions[name].handler = binPath;
const packageConfig = this.generatePackageConfig(runtime, config, binPath);

if (this.serverless.service.functions[name].package) {
if (this.serverless.service.functions[name].package
&& this.serverless.service.functions[name].package.include) {
packageConfig.include = packageConfig.include.concat(
this.serverless.service.functions[name].package.include
);
Expand Down

0 comments on commit 486816c

Please sign in to comment.