@@ -330,24 +330,6 @@ Trace.prototype.getLoadRecord = function(canonical, traceOpts, parentStack) {
330
330
if ( condition . indexOf ( '|' ) == - 1 )
331
331
condition += '|default' ;
332
332
333
- // if the condition values have been provided via traceOpts.conditions
334
- // then we dont need to work out variations from the file system and can just take what is given
335
- if ( traceOpts . conditions [ condition ] ) {
336
- var branches = { } ;
337
- traceOpts . conditions [ condition ] . forEach ( function ( c ) {
338
- var branchCanonical = canonical . substr ( 0 , interpolationMatch . index ) + c + canonical . substr ( interpolationMatch [ 0 ] . length + interpolationMatch . index ) ;
339
- branches [ c ] = branchCanonical ;
340
- } ) ;
341
- return {
342
- name : canonical ,
343
- fresh : false ,
344
- conditional : {
345
- condition : condition ,
346
- branches : branches
347
- }
348
- } ;
349
- }
350
-
351
333
var metadata = { } ;
352
334
return Promise . resolve ( loader . locate ( { name : normalized . replace ( interpolationRegEx , '*' ) , metadata : metadata } ) )
353
335
. then ( function ( address ) {
@@ -378,6 +360,16 @@ Trace.prototype.getLoadRecord = function(canonical, traceOpts, parentStack) {
378
360
branches [ interpolate ] = pathCanonical ;
379
361
} ) ;
380
362
363
+ // if the condition values have been provided via traceOpts.conditions
364
+ // then add these to the glob variations as well
365
+ if ( traceOpts . conditions [ condition ] )
366
+ traceOpts . conditions [ condition ] . forEach ( function ( c ) {
367
+ if ( branches [ c ] )
368
+ return ;
369
+ var branchCanonical = canonical . substr ( 0 , interpolationMatch . index ) + c + canonical . substr ( interpolationMatch [ 0 ] . length + interpolationMatch . index ) ;
370
+ branches [ c ] = branchCanonical ;
371
+ } ) ;
372
+
381
373
return {
382
374
name : canonical ,
383
375
fresh : false , // we never cache conditional interpolates and always reglob
0 commit comments