Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2015-03-17 03:53:11 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-03-17 03:53:11 +0300
commit1549106f518000633915686f5f1ccc6afcf77f8f (patch)
tree04286f1b420957706afe6ad83d92ddca03dd4b25 /lib
parent61915a8ff37ca8e42b9e99e62e7020ceea3a48eb (diff)
shrinkwrap: npm shrinkwrap --dev means prod too
Due to 448efd0eaa6f97af0889bf47efc543a1ea2f8d7e, running `npm shrinkwrap --dev` caused production dependencies to no longer be included in npm-shrinkwrap-.json. Whoopsie! Added a regression test to go with the fix. Fixes #7641.
Diffstat (limited to 'lib')
-rw-r--r--lib/shrinkwrap.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/shrinkwrap.js b/lib/shrinkwrap.js
index a5783837c..03192a3fa 100644
--- a/lib/shrinkwrap.js
+++ b/lib/shrinkwrap.js
@@ -20,6 +20,12 @@ function shrinkwrap (args, silent, cb) {
log.warn("shrinkwrap", "doesn't take positional args")
}
+ // https://github.com/npm/npm/issues/7641
+ // introduced because `npm ls` can now show dev and prod depenednecy
+ // trees separately
+ if (npm.config.get("dev")) {
+ npm.config.set("production", true)
+ }
npm.commands.ls([], true, function (er, _, pkginfo) {
if (er) return cb(er)
shrinkwrap_(pkginfo, silent, npm.config.get("dev"), cb)
@@ -45,7 +51,7 @@ function shrinkwrap_ (pkginfo, silent, dev, cb) {
return
}
- log.warn("shrinkwrap", "Excluding devDependency: %s", dep)
+ log.warn("shrinkwrap", "Excluding devDependency: %s", dep, data.dependencies)
delete pkginfo.dependencies[dep]
})
}