Deploy to Netlify
Netlify provides excellent static site hosting with a generous free tier.
One-Click Deploy
Manual Deployment
Step 1: Connect Repository
- Log in to Netlify
- Click "Add new site" → "Import an existing project"
- Connect your GitHub account
- Select your BentoPDF fork
Step 2: Configure Build Settings
| Setting | Value |
|---|---|
| Build command | npm run build |
| Publish directory | dist |
| Node version | 18+ |
Step 3: Deploy
Click "Deploy site" and wait for the build.
Configuration File
Create netlify.toml in your project root:
toml
[build]
command = "npm run build"
publish = "dist"
[build.environment]
NODE_VERSION = "18"
# SPA routing
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Cache WASM files
[[headers]]
for = "*.wasm"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
Content-Type = "application/wasm"Environment Variables
Set these in Site settings → Environment variables:
| Variable | Description |
|---|---|
SIMPLE_MODE | Set to true for minimal build |
Custom Domain
- Go to Site settings → Domain management
- Click "Add custom domain"
- Follow DNS configuration instructions
Large Media
For large WASM files, consider enabling Netlify Large Media:
bash
netlify lm:setup
git lfs track "*.wasm"Troubleshooting
Build Fails
Check Node version compatibility:
toml
[build.environment]
NODE_VERSION = "20"Slow Initial Load
Enable asset optimization in Site settings → Build & deploy → Asset optimization.