/_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
- Install Node.js 22 or later.
- Use Vite, or a framework built on Vite, such as SvelteKit, Nuxt, or Astro. For other Node.js dev servers, see Use another dev server.
Add the plugin
-
Install the SDK package, which includes the plugin:
-
Add the plugin to your Vite configuration, for example
vite.config.ts:Keep any other plugins your project already lists. -
Start the dev server, for example with
npm run dev.
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.-
In the parent folder of
my-site, install Vite and the SDK package: -
In the same parent folder, create
vite.config.js: -
Run
npx viteand 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.jsfor pages that load the SDK with a script tag.
Use another dev server
For a Node.js dev server that accepts connect-style middleware, useliteshopDevMiddleware() from the same module. It reads
public/liteshop.json unless you pass a manifest path: