File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,25 @@ export const loadFile = (file: string) => {
8888 }
8989 let path ;
9090 let baseUrl = '' ;
91- console . log ( 'loadFile' , file , "import.meta.url" , import . meta. url ) ;
9291 if ( file . startsWith ( '@/' ) ) {
93- console . log ( 'loading from @/' ) ;
9492 path = file . replace ( '@/' , '' ) ;
9593 console . log ( 'path' , path ) ;
96- baseUrl = new URL ( `./${ path } ` , new URL ( import . meta. url ) . origin + new URL ( import . meta. url ) . pathname ) . href ;
94+ const modules = import . meta. glob ( './**/*' ) ;
95+ const fileModulePath = `./${ path } ` ;
96+ let matchingModulePath = '' ;
97+ for ( const modulePath in modules ) {
98+ console . log ( 'modulePath' , modulePath ) ;
99+ if ( modulePath === fileModulePath ) {
100+ matchingModulePath = modulePath ;
101+ break ;
102+ }
103+ }
104+ console . log ( 'matchingModulePath' , matchingModulePath ) ;
105+
106+
107+
108+
109+ baseUrl = new URL ( fileModulePath , import . meta. url ) . href ;
97110 console . log ( 'baseUrl' , baseUrl ) ;
98111 } else if ( file . startsWith ( '@@/' ) ) {
99112 path = file . replace ( '@@/' , '' ) ;
You can’t perform that action at this time.
0 commit comments