Skip to content

Next Plugin: WithPalamedesOptions

Functions, types, and exports for Next Plugin: WithPalamedesOptions.

Page outline
import type { WithPalamedesOptions } from "@palamedes/next-plugin"

type WithPalamedesOptions = {
    /**
     * Files to transform: a glob, a RegExp, or an array of both. Relative globs
     * resolve from `projectRoot`; RegExps test the absolute file path.
     * @default /\.([cm]?[jt]s|[jt]sx)$/
     */
    include?: PalamedesFilterPattern;
    /**
     * Files to skip, with the same pattern rules as `include`.
     * @default /node_modules/
     */
    exclude?: PalamedesFilterPattern;
    /**
     * Enable .po file compilation loader.
     * @default true
     */
    enablePoLoader?: boolean;
    /**
     * Path to a Palamedes config file.
     * Relative paths resolve from the Next project root. If not provided,
     * Palamedes searches for config automatically from that root.
     */
    configPath?: string;
    /**
     * Absolute or relative Next project directory. Set this when Next's project
     * directory cannot be derived automatically, for example in a custom host.
     */
    projectRoot?: string;
    /**
     * If true, fail compilation on missing translations.
     * @default false
     */
    failOnMissing?: boolean;
    /**
     * Advanced override for the module that exports the runtime getter.
     * @default "@palamedes/runtime"
     */
    runtimeModule?: string;
    /**
     * Include authored source messages as diagnostic source metadata.
     * Defaults to `false` in every environment. Set to `true` to include
     * authored source text in generated calls for diagnostics.
     * V2 runtime misses throw; this metadata never provides replacement output.
     */
    includeSourceMetadata?: boolean;
    /**
     * Monorepo workspace root to use for Turbopack and output file tracing.
     * If omitted, Palamedes will try to detect a workspace root from the Next
     * project root.
     */
    workspaceRoot?: string;
    /**
     * Initialize request-local i18n at the start of every recognized Next.js
     * Server Function. Requires a `palamedes.server` entry module exporting
     * `initializeServerFunctionI18n`.
     *
     * Automatically enabled when the conventional entry exists.
     */
    serverFunctions?: boolean;
};

Properties

NameTypeRequiredDescription
includePalamedesFilterPatternNoFiles to transform: a glob, a RegExp, or an array of both. Relative globs
resolve from projectRoot; RegExps test the absolute file path. Default: /\.([cm]?[jt]s|[jt]sx)$/.
excludePalamedesFilterPatternNoFiles to skip, with the same pattern rules as include. Default: /node_modules/.
enablePoLoaderbooleanNoEnable .po file compilation loader. Default: true.
configPathstringNoPath to a Palamedes config file.
Relative paths resolve from the Next project root. If not provided,
Palamedes searches for config automatically from that root.
projectRootstringNoAbsolute or relative Next project directory. Set this when Next's project
directory cannot be derived automatically, for example in a custom host.
failOnMissingbooleanNoIf true, fail compilation on missing translations. Default: false.
runtimeModulestringNoAdvanced override for the module that exports the runtime getter. Default: "@palamedes/runtime".
includeSourceMetadatabooleanNoInclude authored source messages as diagnostic source metadata.
Defaults to false in every environment. Set to true to include
authored source text in generated calls for diagnostics.
V2 runtime misses throw; this metadata never provides replacement output.
workspaceRootstringNoMonorepo workspace root to use for Turbopack and output file tracing.
If omitted, Palamedes will try to detect a workspace root from the Next
project root.
serverFunctionsbooleanNoInitialize request-local i18n at the start of every recognized Next.js
Server Function. Requires a palamedes.server entry module exporting
initializeServerFunctionI18n.

Automatically enabled when the conventional entry exists.

Source entry on GitHub

Last updated: November 1, 2026