← All procedures

vite.preview

Preview production build

CLI
Package
@procedures/vite · README
Path
["vite","preview"]
CLI
mark vite preview
As data
{"$proc":["vite","preview"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/vite"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["vite","preview"], {});
console.log(JSON.stringify(result));

From the command line

$ mark vite preview

As data, in a program

{ "$proc": ["vite", "preview"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
cwdstringnoWorking directory containing built output (default: the current folder)
portnumbernoPort to run on

Output

FieldTypeRequiredDefaultDescription
serverIdstringyesThe id of the server: vite.stop takes it
urlstringyesThe URL of the server
pidnumberyesThe process id of vite
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "cwd": {
        "description": "Working directory containing built output (default: the current folder)",
        "type": "string"
      },
      "port": {
        "description": "Port to run on",
        "type": "number"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "serverId": {
        "type": "string",
        "description": "The id of the server: vite.stop takes it"
      },
      "url": {
        "type": "string",
        "description": "The URL of the server"
      },
      "pid": {
        "type": "number",
        "description": "The process id of vite"
      }
    },
    "required": [
      "serverId",
      "url",
      "pid"
    ],
    "additionalProperties": {}
  }
}