diff --git a/lib/BrowserifyCache.js b/lib/BrowserifyCache.js index 3ce6fdc..c551ef2 100644 --- a/lib/BrowserifyCache.js +++ b/lib/BrowserifyCache.js @@ -20,7 +20,12 @@ function BrowserifyCache(b, opts) { // load cache from file specified by cacheFile opt var cacheFile = opts.cacheFile || opts.cachefile || b._options && b._options.cacheFile || null; - var cacheData = loadCacheData(b, cacheFile); + var cacheData; + if (cacheFile) { + cacheData = loadCacheData(b, cacheFile); + } else { + cacheData = opts.packageCache || b._options && b._options.packageCache; + } // b._options.cache is a shared object into which loaded module cache is merged. // it will be reused for each build, and mutated when the cache is invalidated.