lotio 1.1.52 → 1.1.53
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/browser/lotio.wasm +0 -0
- package/browser/wasm.js +8 -1
- package/package.json +1 -1
package/browser/lotio.wasm
CHANGED
|
Binary file
|
package/browser/wasm.js
CHANGED
|
@@ -38,7 +38,14 @@ export async function initLotio(wasmPath = './lotio.wasm', wasmBinary = null) {
|
|
|
38
38
|
locateFile: (path) => {
|
|
39
39
|
// Resolve WASM file path relative to the JS file
|
|
40
40
|
if (path === 'lotio.wasm') {
|
|
41
|
-
|
|
41
|
+
// If wasmPath is absolute (starts with /), use it directly
|
|
42
|
+
if (wasmPath.startsWith('/') || wasmPath.startsWith('http://') || wasmPath.startsWith('https://') || wasmPath.startsWith('//')) {
|
|
43
|
+
return wasmPath;
|
|
44
|
+
}
|
|
45
|
+
// For relative paths, resolve relative to the lotio.js module location
|
|
46
|
+
// This ensures it works correctly in Vite and other bundlers
|
|
47
|
+
const lotioJsBase = new URL('.', jsPath).href;
|
|
48
|
+
return new URL(wasmPath, lotioJsBase).href;
|
|
42
49
|
}
|
|
43
50
|
// For other files, resolve relative to the JS file location
|
|
44
51
|
if (jsPath.startsWith('http://') || jsPath.startsWith('https://') || jsPath.startsWith('//')) {
|