Next.js
What Gigadrive Network configures for a Next.js build, from the cache handler and the image loader to the single standalone server.
Next.js is the one framework Gigadrive Network integrates with through a build adapter rather than a
set of default paths. The adapter attaches itself to next build, so caching, image optimization
and the edge routing plan are configured without anything in your repository changing.
What is detected
next in dependencies or devDependencies, at the highest priority of any preset. The deployment
is then configured from .gigadrive/nextjs.json, the manifest the adapter writes when the build
completes, rather than from static defaults.
The following behavior applies to Next 16.2 and newer. On an older release the adapter only forces
output: 'standalone', and none of the injections happen.
What the adapter configures
- One Function for the whole application.
output: 'standalone'is set for you, and the standalone server is provisioned as a single Function namednext-serverwith 1024 MB and a streaming/*route. Its maximum duration is the largestmaxDurationany of your route segments declares, and 30 seconds when none do. - A cache handler, injected when your
next.configdoes not already setcacheHandler. ISR,revalidateTaganduse cachethen write to a cache the whole deployment shares instead of the local filesystem, so a revalidation triggered by one invocation is visible to every later one. The in-memory cache is set to zero in that case, since the shared cache is the source of truth. - An image loader, injected when
images.unoptimizedis nottrue,images.loaderisdefault, and you have not set your ownloaderFile.next/imagesources are then rewritten to/_gigadrive/image/...and answered by Image optimization. Sources ending in.svgare passed through untouched, because no optimizer rasterizes SVG. - Your
next.configimage settings as the deployment's image policy.remotePatterns,localPatterns,qualities,formats,minimumCacheTTL,dangerouslyAllowSVG,contentSecurityPolicyandcontentDispositionTypecarry over, anddeviceSizesplusimageSizesbecome one sorted width list. Settingimages.unoptimizedemits no policy at all. .next/staticas a single immutable edge prefix at/_next/static/, rather than one asset entry per hashed chunk. Files inpublicare published individually at their own paths.- A stable Server Actions encryption key for the deployment, plus
NEXT_DEPLOYMENT_ID, injected as build environment variables you cannot override. .next/cachewired into the build cache, so an incremental build reuses the previous deployment's work.
Fully prerendered pages are requested once after publish, so the CDN is warm before your first visitor arrives.
Static exports
A project built with output: 'export' gets no Function. The contents of out are published as
static assets, and each index.html is mapped onto the route path its directory represents, so
out/blog/index.html answers /blog.
A gigadrive.yaml switches the managed integration off
The merge between your config file and a framework preset carries commands, entrypoints, routes, assets, environment
variables, excluded files and services. The Next.js build manifest is not one of them. Any gigadrive.yaml in a
Next.js project therefore leaves the deployment without a Next.js gateway configuration, and the routing plan,
prerender handling and image optimization that read it stop applying. Change next.config.ts or an environment
variable instead.
Next.js documents its own configuration at nextjs.org/docs.
