From 0abdf47d3724604b276eb4989b225fd7fbe60585 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 17 Feb 2011 14:00:49 -0800 Subject: Only rebuild things in the bundle that are visible --- lib/build.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/build.js b/lib/build.js index 5044c3cae..d60d9d293 100644 --- a/lib/build.js +++ b/lib/build.js @@ -67,14 +67,19 @@ function rebuildBundle (pkg, cb) { if (!npm.config.get("rebuild-bundle")) return cb() var bundle = path.join( npm.dir, pkg.name, pkg.version , "package", "node_modules") - fs.stat(bundle, function (er, s) { - if (er || !s.isDirectory()) return cb() + fs.readdir(bundle, function (er, files) { + if (er) return cb() + files = files.filter(function (f) { + return -1 !== f.indexOf("@") && f.charAt(0) !== "." + }) + if (!files.length) return cb() + log.warn(files, "bundled things") log(pkg._id, "rebuilding bundled dependencies") conf.unshift({ root : bundle , binroot : null , manroot : null }) - npm.commands.rebuild([], function (er, data) { + npm.commands.rebuild(files, function (er, data) { conf.shift() cb(er, data) }) -- cgit v1.2.3