viewlogic 1.0.4 → 1.1.1

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 currentScript = document.currentScript ||
29
- Array.from(document.scripts).find(script =>
30
- script.src.includes('viewlogic-router.umd.js'));
31
- if (currentScript && currentScript.src) {
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
- return url.origin + url.pathname.replace(/\/[^\/]*$/, '/');
34
+ const baseUrl = url.origin + url.pathname.replace(/\/[^\/]*$/, '/');
35
+ return baseUrl;
34
36
  }
35
37
  }
36
38
 
37
- // Fallback to CDN if detection fails
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewlogic",
3
- "version": "1.0.4",
3
+ "version": "1.1.1",
4
4
  "description": "A lightweight, file-based routing system for Vue 3 applications with zero build configuration",
5
5
  "main": "dist/viewlogic-router.umd.js",
6
6
  "module": "src/viewlogic-router.js",