@areb0s/scip.js 1.0.5 → 1.0.7

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/scip.js CHANGED
@@ -1,30 +1,16 @@
1
1
 
2
- // Polyfill for import.meta.url in IIFE context (supports Worker)
2
+ // Polyfill for import.meta.url in IIFE context
3
+ // Always use CDN as the base URL for WASM loading
3
4
  var __importMetaUrl = (function() {
4
- // Worker environment
5
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
6
- // Check if SCIP_WASM_BASE_URL is defined (user can set this before loading)
7
- if (typeof SCIP_WASM_BASE_URL !== 'undefined') {
8
- return SCIP_WASM_BASE_URL;
9
- }
10
- // Fallback to self.location
11
- return self.location.href;
12
- }
13
- // Browser main thread
14
- if (typeof document !== 'undefined') {
15
- if (document.currentScript && document.currentScript.src) {
16
- return document.currentScript.src;
17
- }
18
- var scripts = document.getElementsByTagName('script');
19
- for (var i = scripts.length - 1; i >= 0; i--) {
20
- var src = scripts[i].src;
21
- if (src && (src.includes('scip') && src.includes('.js'))) {
22
- return src;
23
- }
24
- }
25
- return window.location.href;
5
+ var CDN_BASE = 'https://cdn.jsdelivr.net/gh/areb0s/scip.js/dist/scip.min.js';
6
+
7
+ // Check for explicit SCIP_BASE_URL first
8
+ if (typeof SCIP_BASE_URL !== 'undefined' && SCIP_BASE_URL) {
9
+ return SCIP_BASE_URL + (SCIP_BASE_URL.endsWith('/') ? '' : '/') + 'scip.min.js';
26
10
  }
27
- return '';
11
+
12
+ // Always return CDN - this ensures WASM is loaded from CDN
13
+ return CDN_BASE;
28
14
  })();
29
15
 
30
16
  var SCIPModule = (() => {