adminforth 2.13.0-next.11 → 2.13.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/spa/src/utils.ts +16 -3
- package/package.json +1 -1
package/dist/spa/src/utils.ts
CHANGED
|
@@ -88,12 +88,25 @@ export const loadFile = (file: string) => {
|
|
|
88
88
|
}
|
|
89
89
|
let path;
|
|
90
90
|
let baseUrl = '';
|
|
91
|
-
console.log('loadFile', file, "import.meta.url", import.meta.url);
|
|
92
91
|
if (file.startsWith('@/')) {
|
|
93
|
-
console.log('loading from @/');
|
|
94
92
|
path = file.replace('@/', '');
|
|
95
93
|
console.log('path', path);
|
|
96
|
-
|
|
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;
|
|
97
110
|
console.log('baseUrl', baseUrl);
|
|
98
111
|
} else if (file.startsWith('@@/')) {
|
|
99
112
|
path = file.replace('@@/', '');
|