utils/resolveAssetPath

Source: resolveAssetPath.js:11

Resolves root-absolute app paths ("/assets/...", "/data/...") against Vite's base (import.meta.env.BASE_URL). Vite only rewrites imported/bundled URLs - runtime fetch() calls and path strings inside the content JSONs are served as-is, so under a subpath deployment (e.g. the test server's ////) they would hit the domain root and 404. Every runtime path therefore goes through here once.


Other

resolveAssetPath

Prefixes a root-absolute path with the app's base path. Full URLs (http/https/protocol-relative), already-relative paths and non-strings are returned unchanged, as is everything when the app is served from "/".

Parameters

  • path (*) — Candidate path, e.g. "/assets/images/foo.webp".

Returns

  • * — The resolved path, e.g. "/group/project/assets/images/foo.webp".

resolveAssetPathsDeep

Recursively resolves every "/assets/..." string inside a content JSON structure via resolveAssetPath. Applied once by ContentProvider right after fetching, so no consumer (element adapters, thumbnails, screensaver video) needs to resolve paths itself.

Parameters

  • value (*) — Any JSON value (object, array, string, ...).

Returns

  • * — A copy with all asset paths resolved.