Skip to content

Commit

Permalink
Skip module if requirePackageName returns null
Browse files Browse the repository at this point in the history
This allows for use of Lambda Layers
  • Loading branch information
developer-carsony authored and e129348 committed Jun 17, 2020
1 parent c1e0d41 commit 2d66937
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions get-dependency-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ module.exports = function(filename, serverless) {

function handle(name, basedir, optionalDependencies, peerDependenciesMeta) {
const moduleName = requirePackageName(name.replace(/\\/, '/'));
if (moduleName === null) {
serverless.cli.log(`[serverless-plugin-include-dependencies]: Module not found, skipping ${name}`);
return null;
}

try {
const pathToModule = resolve.sync(path.join(moduleName, 'package.json'), { basedir });
Expand Down

0 comments on commit 2d66937

Please sign in to comment.