Skip to content

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.

The Netlify build plugin runs automatically after every build with zero configuration.

Terminal window
npm install -D pageflare

Add to netlify.toml:

netlify.toml
[[plugins]]
package = "pageflare"

That’s it. Every deploy is automatically optimized.

Pass extra CLI flags via the args input:

netlify.toml
[[plugins]]
package = "pageflare"
[plugins.inputs]
args = "--force --platform netlify"

Run the plugin only on production deploys, or use different settings for previews:

netlify.toml
# Production
[[context.production.plugins]]
package = "pageflare"
# Deploy previews with different options
[[context.deploy-preview.plugins]]
package = "pageflare"
[context.deploy-preview.plugins.inputs]
args = "--force"

If you prefer not to use the plugin, chain pageflare into your build command:

netlify.toml
[build]
command = "npm run build && npx pageflare dist/ --in-place --no-progress"
publish = "dist"

Or install the CLI globally in the build:

netlify.toml
[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"

Set PAGEFLARE_LICENSE in Site settings > Environment variables to unlock Pro optimizations.

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:

pageflare.jsonc
{
"platform": "netlify"
}

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 errors

If using the build plugin, you’ll also see a “pageflare — Site optimized for PageSpeed” status in the deploy summary.

FrameworkPublish directory
Astrodist/
Next.js static exportout/
Gatsbypublic/
Hugopublic/
Eleventy_site/
Vite / SvelteKitbuild/ or dist/

Set the correct publish directory in netlify.toml to match your framework.

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.