Avenra
MetadataXPlugins
MetadataXPlugins

Next.js plugin

Fail builds on MetadataX lint issues.

The Next.js plugin hooks into the build and can fail on lint issues.

Setup

// next.config.mjs
import { withMetadataX } from "@avenra/metadatax/next-plugin";

/** @type {import('next').NextConfig} */
const nextConfig = {
    reactStrictMode: true,
};

export default withMetadataX(nextConfig, {
    failOn: "error",
});

Fail modes

  • error: fail build on lint issues with level error
  • warning: fail build on warnings and errors
  • all: fail build on any lint issue

On this page