@@ -21,20 +21,16 @@ <h2>Escape relative glob</h2>
2121< pre class ="escape-relative "> </ pre >
2222< h2 > Escape alias glob</ h2 >
2323< pre class ="escape-alias "> </ pre >
24- < h2 > Sub imports</ h2 >
25- < pre class ="sub-imports "> </ pre >
24+ < h2 > Subpath imports</ h2 >
25+ < pre class ="subpath-imports "> </ pre >
26+ < h2 > #alias imports</ h2 >
27+ < pre class ="hash-alias-imports "> </ pre >
2628< h2 > In package</ h2 >
2729< pre class ="in-package "> </ pre >
2830
2931< script type ="module " src ="./dir/index.js "> </ script >
3032< script type ="module ">
3133 function useImports ( modules , selector ) {
32- for ( const path in modules ) {
33- modules [ path ] ( ) . then ( ( mod ) => {
34- console . log ( path , mod )
35- } )
36- }
37-
3834 const keys = Object . keys ( modules )
3935 Promise . all ( keys . map ( ( key ) => modules [ key ] ( ) ) ) . then ( ( mods ) => {
4036 const res = { }
@@ -137,7 +133,6 @@ <h2>In package</h2>
137133 const globs = import . meta. glob ( '/escape/**/glob.js' , {
138134 eager : true ,
139135 } )
140- console . log ( globs )
141136 globalThis . globs = globs
142137 const relative = Object . entries ( globs )
143138 . filter ( ( [ _ , mod ] ) => Object . keys ( mod ?. relative ?? { } ) . length === 1 )
@@ -152,9 +147,19 @@ <h2>In package</h2>
152147</ script >
153148
154149< script type ="module ">
155- const subImports = import . meta. glob ( '#imports/*' , { eager : true } )
150+ const subpathImports = import . meta. glob ( '#imports/*' , { eager : true } )
151+ document . querySelector ( '.subpath-imports' ) . textContent = Object . values (
152+ subpathImports ,
153+ )
154+ . map ( ( mod ) => mod . default )
155+ . join ( ' ' )
156+ </ script >
156157
157- document . querySelector ( '.sub-imports' ) . textContent = Object . values ( subImports )
158+ < script type ="module ">
159+ const hashAliasImports = import . meta. glob ( '#alias/*' , { eager : true } )
160+ document . querySelector ( '.hash-alias-imports' ) . textContent = Object . values (
161+ hashAliasImports ,
162+ )
158163 . map ( ( mod ) => mod . default )
159164 . join ( ' ' )
160165</ script >
0 commit comments