Skip to main content
A local dev server doesn’t have Liteshop’s /_liteshop/ endpoints, so SDK calls fail there. The Liteshop Vite plugin answers those calls from your liteshop.json, so you can try your Site before you publish it.

Before you begin

Add the plugin

  1. Install the SDK package, which includes the plugin:
  2. Add the plugin to your Vite configuration, for example vite.config.ts:
    Keep any other plugins your project already lists.
  3. Start the dev server, for example with npm run dev.
The plugin reads liteshop.json from Vite’s public folder: public/, or static/ in SvelteKit. To use another path, pass it to the plugin:

Test a Site without a build step

For a Site without a build step, such as the HTML quickstart, run Vite from the folder that contains the Site’s folder, so that Vite’s files don’t end up in your ZIP file.
  1. In the parent folder of my-site, install Vite and the SDK package:
  2. In the same parent folder, create vite.config.js:
  3. Run npx vite and open the address it prints.

What the plugin does

  • Checks Form submissions and booking and catalogue requests against liteshop.json, prints them in the dev server’s terminal, and accepts them. Nothing is saved or sent to Liteshop.
  • Returns the manifest’s catalogue from liteshop.catalogue.list(), with every item available.
  • Returns every date as available for nightly and daily Offers. Timed Offers return no slots.
  • Serves /_liteshop/sdk/v1.js for pages that load the SDK with a script tag.
To test real submissions, publish the Site and use its live address.

Use another dev server

For a Node.js dev server that accepts connect-style middleware, use liteshopDevMiddleware() from the same module. It reads public/liteshop.json unless you pass a manifest path: