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
| Name | Type | Required | Description |
|---|---|---|---|
include | PalamedesFilterPattern | No | 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. |
exclude | PalamedesFilterPattern | No | Files to skip, with the same pattern rules as include. Default: /node_modules/. |
enablePoLoader | boolean | No | Enable .po file compilation loader. Default: true. |
configPath | string | No | Path to a Palamedes config file. Relative paths resolve fromprojectRoot. If not provided, Palamedes searches for a config fromprojectRoot upward. |
projectRoot | string | No | Project directory used for config discovery, a relative configPath, andrelative include/exclude globs. Relative values resolve from thecurrent working directory. Default: Vite's resolved `root`, or the current working directory outside Vite. |
skipValidation | boolean | No | Skip validation of the config file. |
failOnMissing | boolean | No | If true, fail compilation on missing translations. Default: false. |
framework | PalamedesFramework | No | UI framework this app compiles for. Selects the component contract for generated MDX modules. Use "none" for a project that is neither Reactnor Solid. Default: "react". |
runtimeModule | string | No | Advanced override for the module the macro transform imports. Generated MDX modules are not affected; configure those through mdx.runtimeModule. Default: "@palamedes/runtime". |
includeSourceMetadata | boolean | No | Include authored source messages as diagnostic source metadata. Defaults to false in every environment. Set to true to retainauthored source text for diagnostics. V2 runtime misses throw; this metadata never provides replacement output. |
mdx | PalamedesMdxConfig | false | No | Override MDX analysis options from the Palamedes config, or disable MDX. Default: configuration `mdx` values with React framework defaults. |
environment | "auto" | "server" | No | Build target of every module this plugin sees. "auto" reads the Viteenvironment (or build.ssr for a hook without one). Set "server" forbundlers without Vite environments, such as tsdown or Rolldown building a Node backend; there every build would otherwise count as a browser build. Default: "auto". |
Last updated: November 1, 2026