@palamedes/vite-plugin
v0.3.0
Published
Vite plugin for Palamedes using OXC-based macro transformation
Maintainers
Readme
@palamedes/vite-plugin
The recommended Palamedes entry point for Vite applications.
@palamedes/vite-plugin gives Vite projects fast macro transforms, .po loading, and a cleaner path than bolting Babel-oriented i18n tooling back onto a modern frontend stack.
Status
- Recommended for Vite projects using React or Solid and Palamedes macros
- Supports
.poimports and source-string-first catalog semantics - Best paired with
@palamedes/runtimeand@palamedes/cli - Not a framework generator or top-level app scaffold
Start Here
Use the full copy-paste setup guide:
Installation
pnpm add @palamedes/core @palamedes/runtime @palamedes/vite-plugin
pnpm add -D @palamedes/cli @palamedes/configThen add the host package pair you want:
pnpm add @palamedes/react react react-dom
pnpm add -D @vitejs/plugin-reactor
pnpm add @palamedes/solid solid-js
pnpm add -D vite-plugin-solidMinimal Setup
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import { palamedes } from "@palamedes/vite-plugin"
export default defineConfig({
plugins: [palamedes(), react()],
})import { defineConfig } from "vite"
import solid from "vite-plugin-solid"
import { palamedes } from "@palamedes/vite-plugin"
export default defineConfig({
plugins: [palamedes(), solid()],
})import { defineConfig } from "@palamedes/config"
export default defineConfig({
locales: ["en", "de"],
sourceLocale: "en",
catalogs: [
{
path: "src/locales/{locale}",
include: ["src"],
},
],
})Transformed code expects getI18n() from @palamedes/runtime, so register the active client i18n instance before translated code executes.
Options
import { palamedes } from "@palamedes/vite-plugin"
palamedes({
include: /\.(tsx?|jsx?|mjs|cjs)$/,
exclude: /node_modules/,
enablePoLoader: true,
configPath: "./palamedes.config.ts",
failOnMissing: false,
failOnCompileError: false,
runtimeModule: "@palamedes/runtime",
})What This Package Handles
- transforms supported message macros before the rest of the Vite pipeline runs
- compiles imported
.pofiles into JavaScript modules - keeps source-string-first catalog semantics aligned with the native core
- reports common macro and catalog issues during dev and build
Related Docs
License
MIT © 2026 Sebastian Software
