Offline Mode

Lovable Prompt
Lovable Prompt

Create a build plugin/script that generates a /despia/local.json file in the build output directory after compilation. This file should contain a JSON array of all asset paths from the build output.

Requirements:

  1. Hook into the build process after all files are written to the output directory

  2. Collect all output filenames (JS, CSS, images, fonts, HTML, etc.)

  3. Format paths as root-relative (starting with /)

  4. Include the entry HTML file (e.g., /index.html) if not already captured

  5. Sort paths alphabetically for consistent output

  6. Create the despia subdirectory in the output folder if it doesn't exist

  7. Write a formatted JSON array (not an object, just the array)

Example output (dist/despia/local.json):

[
  "/assets/app.abc123.css",
  "/assets/app.def456.js",
  "/assets/logo.xyz789.png",
  "/index.html"
]

This manifest is used for offline caching in Despia (despia.com) web-native apps.

Updated on