Netlify
Netlify runs your build command and then deploys the output. pageflare integrates as a post-build step — either through the official build plugin (recommended) or a manual build command override.
Option 1: Build Plugin (recommended)
Section titled “Option 1: Build Plugin (recommended)”The Netlify build plugin runs automatically after every build with zero configuration.
Install
Section titled “Install”npm install -D pageflareAdd to netlify.toml:
[[plugins]]package = "pageflare"That’s it. Every deploy is automatically optimized.
Options
Section titled “Options”Pass extra CLI flags via the args input:
[[plugins]]package = "pageflare" [plugins.inputs] args = "--force --platform netlify"Per-context configuration
Section titled “Per-context configuration”Run the plugin only on production deploys, or use different settings for previews:
# Production[[context.production.plugins]]package = "pageflare"
# Deploy previews with different options[[context.deploy-preview.plugins]]package = "pageflare" [context.deploy-preview.plugins.inputs] args = "--force"Option 2: Build Command Override
Section titled “Option 2: Build Command Override”If you prefer not to use the plugin, chain pageflare into your build command:
[build] command = "npm run build && npx pageflare dist/ --in-place --no-progress" publish = "dist"Or install the CLI globally in the build:
[build] command = "curl -fsSL https://get.appz.dev/pageflare/install.sh | sh && npm run build && ~/.pageflare/bin/pageflare dist/ --in-place --no-progress" publish = "dist"Pro License
Section titled “Pro License”Set PAGEFLARE_LICENSE in Site settings > Environment variables to unlock Pro optimizations.
Platform Image Optimization
Section titled “Platform Image Optimization”When pageflare detects a Netlify environment, it automatically enables platform_images. This rewrites local image references to use Netlify’s Image CDN (/.netlify/images/), which handles format conversion, resizing, and CDN caching.
You can also enable it explicitly in pageflare.jsonc:
{ "platform": "netlify"}Verify the Deployment
Section titled “Verify the Deployment”After deploying, check the Deploy log in the Netlify dashboard. Look for the pageflare summary:
Done 145.2 KB saved (38.1%) 1.2s Files 42 total, 38 optimized, 4 unchanged, 0 errorsIf using the build plugin, you’ll also see a “pageflare — Site optimized for PageSpeed” status in the deploy summary.
Framework Output Directories
Section titled “Framework Output Directories”| Framework | Publish directory |
|---|---|
| Astro | dist/ |
| Next.js static export | out/ |
| Gatsby | public/ |
| Hugo | public/ |
| Eleventy | _site/ |
| Vite / SvelteKit | build/ or dist/ |
Set the correct publish directory in netlify.toml to match your framework.
Troubleshooting
Section titled “Troubleshooting”Plugin not running
Make sure pageflare is listed in your package.json devDependencies and in netlify.toml under [[plugins]].
pageflare processes 0 files
The publish directory doesn’t match where your framework writes output. Check the framework table above and update netlify.toml accordingly.
Build timeout
For very large sites (5000+ files), the optimization step may push the build past Netlify’s time limit. Try adding --force to skip incremental caching, or upgrade your Netlify plan for longer build times.