Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support optional peer dependencies
via `peerDependenciesMeta`
  • Loading branch information
seanmarthur authored Dec 12, 2019
commit 82b703fcd0037392d9214ea10beb80a31dc20bbe
5 changes: 3 additions & 2 deletions get-dependency-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const readPkgUp = require('read-pkg-up');
const requirePackageName = require('require-package-name');
const glob = require('glob');

function ignoreMissing(dependency, optional) {
return optional && dependency in optional;
function ignoreMissing(dependency, optional, peerDependenciesMeta) {
return optional && dependency in optional
|| peerDependenciesMeta && dependency in peerDependenciesMeta && peerDependenciesMeta[dependency].optional;
}

module.exports = function(filename, serverless) {
Expand Down