{"id":22566,"library":"vite-intlayer","title":"vite-intlayer","description":"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.","status":"maintenance","version":"8.7.7","language":"javascript","source_language":"en","source_url":"https://github.com/aymericzip/intlayer","tags":["javascript","intlayer","data","internationalization","multilingual","i18n","typescript","react","vite"],"install":[{"cmd":"npm install vite-intlayer","lang":"bash","label":"npm"},{"cmd":"yarn add vite-intlayer","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-intlayer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for JavaScript/TypeScript compilation of i18n content","package":"@babel/core","optional":false},{"reason":"Peer dependency; plugin only works with Vite >=4.0.0","package":"vite","optional":false}],"imports":[{"note":"This is a named export, not a default export.","wrong":"import viteIntlayer from 'vite-intlayer'","symbol":"viteIntlayer","correct":"import { viteIntlayer } from 'vite-intlayer'"},{"note":"Part of Vite's core, but often confused as an export from vite-intlayer.","wrong":null,"symbol":"defineConfig","correct":"import { defineConfig } from 'vite'"},{"note":"TypeScript only; use 'import type' for type imports.","symbol":"IntlayerPluginOptions","correct":"import type { IntlayerPluginOptions } from 'vite-intlayer'"},{"note":"vite-intlayer does not have a default export in CJS; use destructuring.","wrong":"const viteIntlayer = require('vite-intlayer')","symbol":"default (CommonJS)","correct":"const { viteIntlayer } = require('vite-intlayer')"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { viteIntlayer } from 'vite-intlayer';\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    viteIntlayer({\n      // Configuration options (optional)\n      // locales: ['en', 'fr', 'es'],\n      // defaultLocale: 'en',\n    }),\n  ],\n});","lang":"typescript","description":"Shows how to add the vite-intlayer plugin to a Vite config file, with import and usage."},"warnings":[{"fix":"Replace 'vite-plugin-intlayer' with 'vite-intlayer' in package.json and imports.","message":"In version 2.x, the plugin was renamed from 'vite-plugin-intlayer' to 'vite-intlayer'. Update your imports.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Move redirect configuration under localeDetection: { redirect: ... }.","message":"The 'redirect' option in plugin configuration has been deprecated; use 'localeDetection.redirect' instead.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Set 'strict: true' in tsconfig.json.","message":"If using TypeScript, ensure 'strict' mode is enabled to avoid type errors with locale dictionaries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add an alias in vite.config.ts: resolve: { alias: { '@intlayer/locales': path.resolve(__dirname, 'locales') } }.","message":"The plugin expects Vite's resolve.alias to be configured if you have custom locale directory paths; otherwise locales may not be found.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to version 16 or later.","message":"Support for Node.js <14.18 is deprecated; future versions may require Node >=16.","severity":"deprecated","affected_versions":">=6.0.0"}],"env_vars":null,"search_vec":"'2.0.13':29 '4.0.0':55 '8.7.7':18 'automat':65 'base':46,68 'companion':78 'compil':79 'configur':47 'current':14 'data':82 'detect':41 'dictionari':63 'differenti':57 'ecosystem':33 'environ':45 'environment-bas':44 'framework':76 'i18n':10,85 'integr':36,59 'internation':9,83 'intlay':3,32,61,81 'intlayer/core':38 'javascript':80 'key':56 'local':40,67 'locale-bas':66 'multilingu':84 'note':20 'plugin':6,35 'project':13 'react':73,87 'recent':22 'redirect':42,69 'releas':23 'requir':53 'seamless':8 'separ':26 'ship':49 'show':24 'stabl':15 'support':71 'system':64 'tight':58 'track':28 'type':51 'typescript':50,86 'version':16,27 'via':77 'vite':2,5,12,54,88 'vite-intlay':1","created_at":"2026-04-27T17:05:51.024027+00:00","updated_at":"2026-04-27T17:05:51.024027+00:00","problems":[{"fix":"Run 'npm install vite-intlayer' and ensure your import matches the package name.","cause":"The package is not installed or is installed under an old name.","error":"Error: Cannot find module 'vite-intlayer'"},{"fix":"Change import to: import { viteIntlayer } from 'vite-intlayer'","cause":"Default import was used instead of named import.","error":"TypeError: viteIntlayer is not a function"},{"fix":"Install @intlayer/config: npm install @intlayer/config","cause":"Missing peer dependency @intlayer/config.","error":"[vite] Internal server error: Failed to resolve import \"@intlayer/config\" from \"vite-intlayer\""},{"fix":"Move redirect option under localeDetection object as documented.","cause":"Using deprecated configuration key.","error":"ERROR: The 'redirect' option is not allowed. Use 'localeDetection.redirect' instead."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://intlayer.org","github":"https://github.com/aymericzip/intlayer","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-intlayer","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}