properly use builder-generated npm path

This fix obviates the direct need for bb7710067, but given that we are
allowing colons in package names, we might as well allow them in
generated file names anyway (and keep bb7710067).
This commit is contained in:
David Glasser
2014-06-17 15:10:04 -07:00
parent 848a5a2a38
commit 15401c028b

View File

@@ -1152,9 +1152,21 @@ _.extend(JsImage.prototype, {
item.targetPath,
{ data: new Buffer(item.source, 'utf8') });
var loadItem = {
path: loadPath,
node_modules: item.nodeModulesDirectory ?
item.nodeModulesDirectory.preferredBundlePath : undefined
path: loadPath
};
if (item.nodeModulesDirectory) {
// We need to make sure to use the directory name we got from
// builder.generateFilename here.
// XXX these two parallel data structures of self.jsToLoad and
// self.nodeModulesDirectories are confusing
var generatedNMD = _.findWhere(
nodeModulesDirectories,
{sourcePath: item.nodeModulesDirectory.sourcePath}
);
if (generatedNMD) {
loadItem.node_modules = generatedNMD.preferredBundlePath;
}
};
if (item.sourceMap) {