From b349bee6411536018a7cf1e173a5ea7bfa27d109 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 22 Dec 2016 17:57:43 +0200 Subject: [PATCH] use a more robust cache directory name for non-NPM packages --- src/config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index 83d5e91217..94632fc6c8 100644 --- a/src/config.js +++ b/src/config.js @@ -295,11 +295,14 @@ export default class Config { let uid = pkg.uid; if (pkg.registry) { name = `${pkg.registry}-${name}`; - uid = pkg.version || uid; } const {hash} = pkg.remote; - if (hash) { + + if (pkg.version && (pkg.version !== pkg.uid)) { + uid = `${pkg.version}-${uid}`; + + } else if (hash) { uid += `-${hash}`; }