Skip to main content

Installation

Add the @despia/local plugin to your build:

Framework integration

Covers React, Vue, Svelte, Preact, and Lit projects using Vite.
vite.config.js

Configuration options

All plugins accept the same options:

Manifest schema

The plugin hooks into your build tool’s completion event, scans the output directory, and generates the manifest at despia/local.json.
The manifest must always be served at despia/local.json relative to your web app’s root. Do not change this path. Despia expects it at this exact location to detect and apply updates.
despia/local.json
This manifest enables Despia to discover all assets for complete caching, determine changes via deployed_at, guarantee offline operation, and perform atomic updates safely.

Version guards

For apps that need to maintain compatibility across different runtime versions, use despia-version-guard to conditionally render features based on the installed native runtime version.
despia-version-guard supports React, Vue, Angular, Svelte, and Vanilla JS / Web Components.

Troubleshooting

Manifest not generated
  • Ensure the build completes without errors before checking for the manifest
  • Confirm the output directory exists at the path specified in outDir
  • Verify the outDir option matches your build tool’s configured output directory
  • Check the console for error messages from the plugin
Missing assets in manifest
  • The plugin scans the entire output directory - confirm assets are copied there during the build step
  • Check that file paths resolve correctly relative to the output root
Path format issues
  • All paths are automatically normalised to root-relative format
  • Paths starting with / are preserved as-is
  • Windows backslashes are converted to forward slashes automatically

Resources

@despia/local on npm

Full package documentation, version history, and changelog.

despia-native SDK

Reference for the JavaScript bridge and all 50+ native API bindings.