Railway
Railway auto-detects your framework and runs builds from Git. pageflare integrates by customizing the build command to add a post-build optimization step.
How It Works
Section titled “How It Works”Override Railway’s build command in the dashboard or railway.json to run pageflare after your framework’s build.
Step 1 — Install pageflare
Section titled “Step 1 — Install pageflare”npm install -D @pageflare/cliStep 2 — Configure the Build
Section titled “Step 2 — Configure the Build”Dashboard
Section titled “Dashboard”In your Railway service settings, set the Build Command to:
npm run build && npx @pageflare/cli dist/ --in-place --no-progressrailway.json
Section titled “railway.json”{ "$schema": "https://railway.com/railway.schema.json", "build": { "buildCommand": "npm run build && npx @pageflare/cli dist/ --in-place --no-progress" }}Step 3 — Pro License
Section titled “Step 3 — Pro License”- Go to your service in the Railway dashboard.
- Open the Variables tab.
- Add
PAGEFLARE_LICENSEwith your license key.
Step 4 — Verify
Section titled “Step 4 — Verify”After deploying, check the Build Logs in the Railway dashboard for the pageflare summary:
Done 145.2 KB saved (38.1%) 1.2s Files 42 total, 38 optimized, 4 unchanged, 0 errorsFramework Output Directories
Section titled “Framework Output Directories”| Framework | Output directory |
|---|---|
| Astro | dist/ |
| Next.js static export | out/ |
| Hugo | public/ |
| Vite | dist/ |
| Eleventy | _site/ |
Troubleshooting
Section titled “Troubleshooting”Build command not used Railway may use Nixpacks auto-detection instead of your custom build command. Set the build command explicitly in the dashboard to override auto-detection.
pageflare processes 0 files The output directory in the build command doesn’t match your framework’s output. Check the table above.