Build Process
Evidence uses a two-step build process:- Build source data - Query your data sources and generate static data files
- Build the app - Create static HTML, CSS, and JavaScript files
Build Commands
Evidence provides several CLI commands for building your app:Build Output
Theevidence build command:
- Runs
npx vite buildin the.evidence/templatedirectory - Generates a static site in the
./builddirectory - Uses
@sveltejs/adapter-staticto create static HTML files - Includes hashed data files for cache invalidation
- Static HTML pages for each route
- JavaScript bundles
- CSS stylesheets
- Data files in Parquet format (in
data/directory) - A
manifest.jsonfile tracking rendered data files
Environment Variables
Control the build process with environment variables:| Variable | Default | Description |
|---|---|---|
EVIDENCE_BUILD_DIR | ./build | Output directory for built files |
EVIDENCE_DATA_DIR | ./static/data | Directory for source data files |
EVIDENCE_DATA_URL_PREFIX | static/data | URL prefix for data files |
NODE_OPTIONS | - | Node.js options (automatically set to --max-old-space-size=4096) |
Strict Mode
Thebuild: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
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:- Runs
npx serve buildto serve the built files - Starts a local server (typically on port 3000)
- Supports SPA mode with the
-sflag whenVITE_EVIDENCE_SPA=true
Memory Configuration
Evidence automatically increases Node.js memory limits during builds to4096MB. This prevents out-of-memory errors when building large projects.
To override this, set NODE_OPTIONS before building:
Next Steps
- Configure rendering modes for your deployment
- Set up base paths for subdirectory deployments
- Manage environments for different deployment targets