Vite · Example Payload

Vite Javascript Api Build Example

Example of programmatically triggering a Vite production build using build().

Build ToolsBundlerDevelopment ServerESMFrontendHot Module ReplacementJavaScriptPlugin APITypeScriptVite

Vite Javascript Api Build Example is an example object payload from Vite, with 5 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

titledescriptionoperationrequestresponse

Example Payload

Raw ↑
{
  "title": "Trigger Vite Production Build",
  "description": "Example of programmatically triggering a Vite production build using build().",
  "operation": "build",
  "request": {
    "function": "build",
    "config": {
      "root": "/my-project",
      "mode": "production",
      "build": {
        "outDir": "dist",
        "assetsDir": "assets",
        "sourcemap": false,
        "minify": "esbuild",
        "emptyOutDir": true
      }
    }
  },
  "response": {
    "type": "RollupOutput",
    "output": [
      {
        "type": "chunk",
        "fileName": "assets/index-Bs3yAOe7.js",
        "isEntry": true,
        "code": "...",
        "modules": {}
      },
      {
        "type": "asset",
        "fileName": "index.html",
        "source": "<!DOCTYPE html>..."
      }
    ]
  }
}