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.
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
- return wasmPath;
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('//')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lotio",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "description": "High-performance Lottie animation frame renderer for the browser",
5
5
  "main": "browser/index.js",
6
6
  "module": "browser/index.js",