From 1772e27be24c9859319de76bc617f1de58128efa Mon Sep 17 00:00:00 2001 From: Manuel Mujica Date: Mon, 1 May 2017 12:13:17 -0600 Subject: [PATCH] Copy `versions` to local loader --- ext/npm-convert.js | 1 + ext/npm.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/npm-convert.js b/ext/npm-convert.js index e5463004f..625e83fca 100644 --- a/ext/npm-convert.js +++ b/ext/npm-convert.js @@ -279,6 +279,7 @@ function convertToPackage(context, npmPkg, index) { var nameAndVersion = pkg.name+"@"+pkg.version; var localPkg; if(!packages[nameAndVersion]) { + crawl.setVersionsConfig(context, pkg, pkg.version); if(pkg.browser){ delete pkg.browser.transform; } diff --git a/ext/npm.js b/ext/npm.js index b0f5fb61b..9175b619b 100644 --- a/ext/npm.js +++ b/ext/npm.js @@ -24,7 +24,10 @@ exports.translate = function(load){ var resavePackageInfo = isNode && loader.isEnv && !loader.isEnv("production"); + var prevPackages = loader.npmContext && loader.npmContext.pkgInfo; + var versions = loader.npmContext && loader.npmContext.versions; + var context = { packages: [], pkgInfo: [], @@ -33,7 +36,7 @@ exports.translate = function(load){ paths: {}, // paths that are currently be loaded loadingPaths: {}, - versions: {}, + versions: utils.extend({}, versions), // A map of packages to its parents. This is used so that // we can find a package by name and get its parent packages, // in order to load bare module specifiers that refer to packages