@hortonstudio/main 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/index.js +16 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,12 +27,18 @@ const postWebflowCallbacks = [];
27
27
  // Get the base URL from the current script's location
28
28
  const getBaseUrl = () => {
29
29
  const currentScript = document.querySelector('script[data-hs-main]');
30
+ console.log('🔍 Script tag found:', currentScript);
31
+ console.log('🔍 Script src:', currentScript?.src);
32
+
30
33
  if (currentScript && currentScript.src) {
31
- // Extract directory path from script URL
32
- return currentScript.src.substring(0, currentScript.src.lastIndexOf('/') + 1);
34
+ const result = currentScript.src.substring(0, currentScript.src.lastIndexOf('/') + 1);
35
+ console.log('🔍 Base URL from script:', result);
36
+ return result;
33
37
  }
34
- // Fallback to current origin + path for relative imports
35
- return new URL('./', import.meta.url).href;
38
+
39
+ const fallback = new URL('./', import.meta.url).href;
40
+ console.log('🔍 Base URL from import.meta:', fallback);
41
+ return fallback;
36
42
  };
37
43
 
38
44
  const loadModule = (moduleName) => {
@@ -52,6 +58,12 @@ const loadModule = (moduleName) => {
52
58
  const baseUrl = getBaseUrl();
53
59
  const absoluteUrl = new URL(modulePath, baseUrl).href;
54
60
 
61
+ // DEBUG: Log what URLs we're creating
62
+ console.log('🔍 Debug info for module:', moduleName);
63
+ console.log(' - Base URL:', baseUrl);
64
+ console.log(' - Module path:', modulePath);
65
+ console.log(' - Final URL:', absoluteUrl);
66
+
55
67
  return import(absoluteUrl);
56
68
  };
57
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {