File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -3,27 +3,38 @@ var systemNormalize = System.normalize;
33System . normalize = function ( path , importFrom ) {
44 var promise = systemNormalize . apply ( this , arguments ) ;
55 promise . then ( function ( normalizedPath ) {
6- imports [ normalizedPath ] = {
6+ updateData ( normalizedPath , {
77 importPath : path ,
88 path : normalizedPath ,
99 from : importFrom ,
1010 deps : [ ]
11- } ;
11+ } ) ;
1212 } ) ;
1313 return promise ;
1414} ;
1515
1616var systemLocate = System . locate ;
1717System . locate = function ( load ) {
18- var importData = imports [ load . name ] ;
19- importData . metadata = load . metadata ;
18+ var importData = updateData ( load . name , {
19+ metadata : load . metadata
20+ } )
2021 var fromData = imports [ importData . from ] ;
2122 if ( fromData ) {
2223 fromData . deps . push ( importData ) ;
2324 }
2425 return systemLocate . apply ( this , arguments ) ;
2526} ;
2627
28+ function updateData ( normalizedPath , data ) {
29+ // create data if doesn't exist
30+ var currData = imports [ normalizedPath ] = imports [ normalizedPath ] || { } ;
31+ // extend data
32+ for ( var key in data ) {
33+ currData [ key ] = data [ key ] ;
34+ }
35+ return currData ;
36+ }
37+
2738export function logImport ( importData ) {
2839 console . groupCollapsed ( importData . importPath ) ;
2940 console . log ( 'path: ' , importData . path ) ;
You can’t perform that action at this time.
0 commit comments