Skip to content
Permalink
Browse files

Return all packages from getProdPackageNames if package.json missing.

  • Loading branch information
benjamn committed Jul 12, 2016
1 parent c1dc320 commit 7b2193188fc9e297eefc841ce6035825164f0684
Showing with 16 additions and 3 deletions.
  1. +16 −3 tools/isobuild/meteor-npm.js
@@ -119,9 +119,22 @@ meteorNpm.updateDependencies = function (packageName,
// Returns a flattened list of npm package names used in production.
meteorNpm.getProdPackageNames = function (nodeModulesDir) {
var names = Object.create(null);
var lsResult = runNpmCommand([
"ls", "--json", "--production"
], nodeModulesDir);
var lsCmdArgs = ["ls", "--json"];

const packageJsonPath = files.pathJoin(
files.pathDirname(nodeModulesDir),
"package.json"
);

const packageJsonStat = files.statOrNull(packageJsonPath);
if (packageJsonStat &&
packageJsonStat.isFile()) {
// If there is no package.json file, adding --production will cause
// the names object to be empty, which is not what we want.
lsCmdArgs.push("--production");
}

var lsResult = runNpmCommand(lsCmdArgs, nodeModulesDir);

function walk(deps) {
if (! deps) {

0 comments on commit 7b21931

Please sign in to comment.
You can’t perform that action at this time.