Skip to content

Vite Plugin: PalamedesPluginOptions

Functions, types, and exports for Vite Plugin: PalamedesPluginOptions.

Page outline
import type { PalamedesPluginOptions } from "@palamedes/vite-plugin"

type PalamedesPluginOptions = {
    /**
     * Files to transform: a glob, a RegExp, or an array of both. Relative globs
     * resolve from `projectRoot`; RegExps test the absolute file path.
     * @default JavaScript, TypeScript, Vue, and Svelte component files
     */
    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
     * `projectRoot`. If not provided, Palamedes searches for a config from
     * `projectRoot` upward.
     */
    configPath?: string;
    /**
     * Project directory used for config discovery, a relative `configPath`, and
     * relative `include`/`exclude` globs. Relative values resolve from the
     * current working directory.
     * @default Vite's resolved `root`, or the current working directory outside Vite
     */
    projectRoot?: string;
    /**
     * Skip validation of the config file.
     */
    skipValidation?: boolean;
    /**
     * If true, fail compilation on missing translations.
     * @default false
     */
    failOnMissing?: boolean;
    /**
     * UI framework this app compiles for. Selects the component contract for
     * generated MDX modules. Use `"none"` for a project that is neither React
     * nor Solid.
     * @default "react"
     */
    framework?: PalamedesFramework;
    /**
     * Advanced override for the module the macro transform imports. Generated
     * MDX modules are not affected;
     * configure those through `mdx.runtimeModule`.
     * @default "@palamedes/runtime"
     */
    runtimeModule?: string;
    /**
     * Include authored source messages as diagnostic source metadata.
     * Defaults to `false` in every environment. Set to `true` to retain
     * authored source text for diagnostics.
     * V2 runtime misses throw; this metadata never provides replacement output.
     */
    includeSourceMetadata?: boolean;
    /**
     * Override MDX analysis options from the Palamedes config, or disable MDX.
     * @default configuration `mdx` values with React framework defaults
     */
    mdx?: PalamedesMdxConfig | false;
    /**
     * Build target of every module this plugin sees. `"auto"` reads the Vite
     * environment (or `build.ssr` for a hook without one). Set `"server"` for
     * bundlers without Vite environments, such as tsdown or Rolldown building a
     * Node backend; there every build would otherwise count as a browser build.
     * @default "auto"
     */
    environment?: "auto" | "server";
};

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: JavaScript, TypeScript, Vue, and Svelte component files.
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
projectRoot. If not provided, Palamedes searches for a config from
projectRoot upward.
projectRootstringNoProject directory used for config discovery, a relative configPath, and
relative include/exclude globs. Relative values resolve from the
current working directory. Default: Vite's resolved `root`, or the current working directory outside Vite.
skipValidationbooleanNoSkip validation of the config file.
failOnMissingbooleanNoIf true, fail compilation on missing translations. Default: false.
frameworkPalamedesFrameworkNoUI framework this app compiles for. Selects the component contract for
generated MDX modules. Use "none" for a project that is neither React
nor Solid. Default: "react".
runtimeModulestringNoAdvanced override for the module the macro transform imports. Generated
MDX modules are not affected;
configure those through mdx.runtimeModule. Default: "@palamedes/runtime".
includeSourceMetadatabooleanNoInclude authored source messages as diagnostic source metadata.
Defaults to false in every environment. Set to true to retain
authored source text for diagnostics.
V2 runtime misses throw; this metadata never provides replacement output.
mdxPalamedesMdxConfig | falseNoOverride MDX analysis options from the Palamedes config, or disable MDX. Default: configuration `mdx` values with React framework defaults.
environment"auto" | "server"NoBuild target of every module this plugin sees. "auto" reads the Vite
environment (or build.ssr for a hook without one). Set "server" for
bundlers without Vite environments, such as tsdown or Rolldown building a
Node backend; there every build would otherwise count as a browser build. Default: "auto".

Source entry on GitHub

Last updated: November 1, 2026