@@ -259,25 +259,30 @@ export default class PackageRequest {
259
259
// only do this in strict lockfile mode as otherwise we can just use our root lockfile
260
260
let subLockfile = null ;
261
261
if ( ! this . resolver . lockfile . strict ) {
262
+ // get possible mirror path
263
+ let offlineMirrorPath = this . config . getOfflineMirrorPath ( ref . remote . registry , ref . remote . reference ) ;
264
+
262
265
// while we're fetching the package we have some idle time to warm the cache with
263
266
// registry responses for known dependencies
264
- for ( let name in info . dependencies ) {
265
- // TODO not needed for offline installation
266
- this . warmCacheIfRegistry ( `${ name } @${ info . dependencies [ name ] } ` ) ;
267
+ if ( ! offlineMirrorPath ) {
268
+ for ( let name in info . dependencies ) {
269
+ this . warmCacheIfRegistry ( `${ name } @${ info . dependencies [ name ] } ` ) ;
270
+ }
267
271
}
268
272
269
273
//
270
274
let { package : newInfo , hash, dest } = await this . resolver . fetchingQueue . push (
271
275
info . name ,
272
276
( ) => this . resolver . fetcher . fetch ( ref )
273
277
) ;
274
- let offlineMirrorPath = this . config . getOfflineMirrorPath ( ref . remote . registry , ref . remote . reference ) ;
275
- // replace resolved remote URL with local path
278
+
279
+ // replace resolved remote URL with local path if lockfile is in save mode and we have a path
276
280
if ( this . resolver . lockfile . save && offlineMirrorPath ) {
277
281
if ( await fs . exists ( offlineMirrorPath ) ) {
278
282
remote . resolved = path . relative (
279
283
this . config . getOfflineMirrorPath ( ref . remote . registry ) ,
280
- offlineMirrorPath ) + `#${ ref . remote . hash } ` ;
284
+ offlineMirrorPath
285
+ ) + `#${ ref . remote . hash } ` ;
281
286
}
282
287
}
283
288
remote . hash = hash ;
0 commit comments