Skip to main content
Evidence builds static sites that can be deployed to any static hosting platform. This guide covers the build process and available deployment options.

Build Process

Evidence uses a two-step build process:
  1. Build source data - Query your data sources and generate static data files
  2. Build the app - Create static HTML, CSS, and JavaScript files

Build Commands

Evidence provides several CLI commands for building your app:
# Build data from sources
npm run sources

# Build the app for production
npm run build

# Build with strict error checking
npm run build:strict

Build Output

The evidence build command:
  • Runs npx vite build in the .evidence/template directory
  • Generates a static site in the ./build directory
  • Uses @sveltejs/adapter-static to create static HTML files
  • Includes hashed data files for cache invalidation
The build output includes:
  • Static HTML pages for each route
  • JavaScript bundles
  • CSS stylesheets
  • Data files in Parquet format (in data/ directory)
  • A manifest.json file tracking rendered data files

Environment Variables

Control the build process with environment variables:
VariableDefaultDescription
EVIDENCE_BUILD_DIR./buildOutput directory for built files
EVIDENCE_DATA_DIR./static/dataDirectory for source data files
EVIDENCE_DATA_URL_PREFIXstatic/dataURL prefix for data files
NODE_OPTIONS-Node.js options (automatically set to --max-old-space-size=4096)

Strict Mode

The build:strict command enables strict error checking:
  • Fails the build on query errors
  • Blocks builds when datasets marked with emptySet="error" are empty
  • Useful for CI/CD pipelines to catch errors before deployment
npm run build:strict

Deployment Options

Evidence can be deployed to any platform that supports static sites:

Platform-Specific Guides

  • Netlify - Deploy with continuous deployment from Git
  • Vercel - Deploy with zero configuration
  • Docker - Deploy with containerization
  • Static Hosting - Deploy to any static hosting provider

Self-Hosted Options

Evidence supports deployment to:
  • Netlify
  • Vercel
  • AWS Amplify
  • Azure Static Web Apps
  • Cloudflare Pages
  • Firebase Hosting
  • GitHub Pages
  • GitLab Pages
  • Hugging Face Spaces
  • Any static file server

Preview Your Build

Before deploying, preview your production build locally:
npm run preview
This command:
  • Runs npx serve build to serve the built files
  • Starts a local server (typically on port 3000)
  • Supports SPA mode with the -s flag when VITE_EVIDENCE_SPA=true

Memory Configuration

Evidence automatically increases Node.js memory limits during builds to 4096MB. This prevents out-of-memory errors when building large projects. To override this, set NODE_OPTIONS before building:
NODE_OPTIONS="--max-old-space-size=8192" npm run build

Next Steps

Build docs developers (and LLMs) love