Skip to main content

loa resolve

loa resolve​

Generate a runtime URL map, preferring locally pulled files

Writes an optional alias-to-URL map to asset-resolution.json at the workspace root. Requires a matching lockfile and makes no registry or download requests. Serve the JSON with your application and load it before the first asset request. Vite users can use virtual:loa instead of exporting this file.

The default auto mode checks each native asset and direct URL for a pulled file in project-local asset_cache/. Present files receive local URLs; absent files keep their remote URLs. Native local bytes are hash-verified before use; a mismatch fails without replacing the previous map. Direct URL downloads remain unverified. Live file: entries retain their live serving URLs.

--mode remote forces native and direct URL sources to their remote URLs. --mode local forces their expected project-cache URLs. Detection occurs when the command runs, not during a loader request; regenerate the map after pulling or removing local files.

Use --output for another JSON destination and --base-url for the public prefix of local asset URLs. Configure your server to serve those paths. Live file: sources require explicit serving or bundling, including files outside the project directory; the Vite plugin supplies that integration.

Usage​

loa resolve [--mode <mode>] [--output <output>] [--base-url <base-url>]
FlagTypeRequiredDescription
--modestringNoPrefer locally pulled files when present, or force remote/local URLs; Choices: auto, remote, local; Default: auto
--outputstringNoOutput JSON file (default: asset-resolution.json at workspace root)
--base-urlstringNoPublic URL prefix used for local assets; Default: /

Examples​

Prefer available local files​

loa resolve

Force remote URLs​

loa resolve --mode remote

Export local URLs under a deployment prefix​

loa resolve --mode local --base-url /showroom/ --output public/asset-resolution.json