Skip to content

Commit

Permalink
Don't strip out optional dependencies when packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
sedwards2009 committed Nov 14, 2019
1 parent e6875f4 commit 3b4bbbf
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 355 deletions.
6 changes: 5 additions & 1 deletion build_scripts/dependency_pruner.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ function objectToDependencyList(dependencies) {

function readPrimaryDependencies(pkgPath) /*: Dependency[] */ {
const pkg = readPackageJson(pkgPath);
return objectToDependencyList(pkg.dependencies);
let deps = objectToDependencyList(pkg.dependencies);
if (pkg.optionalDependencies !== undefined) {
deps = [...deps, ...objectToDependencyList(pkg.optionalDependencies)];
}
return deps;
}

function findPrimaryDependencies(sourceRootPath) /*: Dependency[] */ {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"electron-rebuild": "1.8.5",
"git-repo-info": "^1.4.1",
"jest": "23.6.0",
"modclean": "2.1.0",
"modclean": "3.0.0-beta.1",
"shelljs": "0.8.3",
"wsrun": "3.6.2"
}
Expand Down
Loading

0 comments on commit 3b4bbbf

Please sign in to comment.