viewlogic 1.0.4 → 1.1.0
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.
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
function getBaseUrl() {
|
|
26
26
|
// Try to detect current script URL to determine base path
|
|
27
27
|
if (typeof document !== 'undefined') {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const scripts = Array.from(document.scripts);
|
|
29
|
+
const currentScript = scripts.find(script =>
|
|
30
|
+
script.src && script.src.includes('viewlogic-router.umd.js')
|
|
31
|
+
);
|
|
32
|
+
if (currentScript) {
|
|
32
33
|
const url = new URL(currentScript.src);
|
|
33
|
-
|
|
34
|
+
const baseUrl = url.origin + url.pathname.replace(/\/[^\/]*$/, '/');
|
|
35
|
+
return baseUrl;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
return 'https://unpkg.com/viewlogic@latest/dist/';
|
|
39
|
+
return 'https://cdn.jsdelivr.net/npm/viewlogic/dist/';
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
function getRouterPath(environment) {
|
package/package.json
CHANGED