Skip to content

Adapter Vercel Image Optimizations #8561

@hartwm

Description

@hartwm

Describe the problem

Would be really awesome if adapter-vercel package accepted images option for using Vercel's native image optimization. It only requires simple addition of images object to build config file .vercel/output/config.json. I would submit a pull request but I am sure the options, naming conventions, etc would not be as the team would desire. Given it is such a straightforward task it probably wouldn't prove helpful.

Describe the proposed solution

Here are the options

type ImageFormat = 'image/avif' | 'image/webp';

type RemotePattern = {
  protocol?: 'http' | 'https';
  hostname: string;
  port?: string;
  pathname?: string;
};

type ImagesConfig = {
  sizes: number[];
  domains: string[];
  remotePatterns?: RemotePattern[];
  minimumCacheTTL?: number; // seconds
  formats?: ImageFormat[];
  dangerouslyAllowSVG?: boolean;
  contentSecurityPolicy?: string;
};

https://vercel.com/docs/concepts/image-optimization
https://vercel.com/docs/build-output-api/v3#build-output-configuration/supported-properties/images

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions