Configuration

assetPrefix configuration

assetPrefix configures the prefix for framework-generated static JavaScript and CSS assets under /_next/static. It does not mount application routes or automatically prefix public files. Use basePath for a path mount. The example host is illustrative; no live CDN is contacted. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
assetPrefix: 'https://assets.example.com'

Working Example

Example Snippetnextjs
// Illustrative next.config.mjs, not a live asset hostexport default { assetPrefix: 'https://assets.example.com' };
Next.js Reference