A Vite plugin for seamless internationalization (i18n) in Vite projects. Current stable version is 8.7.7, but note that recent releases show a separate version track (2.0.13) for the intlayer ecosystem; the plugin integrates with @intlayer/core for locale detection, redirection, and environment-based configuration. It ships TypeScript types and requires Vite >=4.0.0. Key differentiators: tight integration with Intlayer's dictionary system, automatic locale-based redirects, and support for React and other frameworks via companion compilers.
npm install vite-intlayerVerified import paths — ran on the pinned version, not inferred.
Shows how to add the vite-intlayer plugin to a Vite config file, with import and usage.
Replace 'vite-plugin-intlayer' with 'vite-intlayer' in package.json and imports.
Move redirect configuration under localeDetection: { redirect: ... }.Set 'strict: true' in tsconfig.json.
Add an alias in vite.config.ts: resolve: { alias: { '@intlayer/locales': path.resolve(__dirname, 'locales') } }.Upgrade Node.js to version 16 or later.
Run 'npm install vite-intlayer' and ensure your import matches the package name.
Change import to: import { viteIntlayer } from 'vite-intlayer'Install @intlayer/config: npm install @intlayer/config
Move redirect option under localeDetection object as documented.