{"id":22437,"library":"tangl-i18next-vite","title":"tangl-i18next-vite","description":"Vite plugin for seamless i18next internationalization integration, v1.2.4. Provides fast, optimized bundling with automatic locale splitting and TypeScript support. Actively maintained. Differentiator: lightweight, zero-config setup compared to heavier alternatives like react-i18next.","status":"active","version":"1.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/tangl-services/tangl-dev","tags":["javascript","tangl","typescript"],"install":[{"cmd":"npm install tangl-i18next-vite","lang":"bash","label":"npm"},{"cmd":"yarn add tangl-i18next-vite","lang":"bash","label":"yarn"},{"cmd":"pnpm add tangl-i18next-vite","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CJS require will fail.","wrong":"const tanglI18nextVite = require('tangl-i18next-vite')","symbol":"default","correct":"import tanglI18nextVite from 'tangl-i18next-vite'"},{"note":"Named export, ensure correct spelling.","wrong":"import { tanglI18nextVite } from 'tangl-i18next-vite'","symbol":"vitePlugin","correct":"import { tanglI18nextVite } from 'tangl-i18next-vite'"},{"note":"TypeScript type import to avoid runtime bundle inclusion.","wrong":"import { PluginOptions } from 'tangl-i18next-vite'","symbol":"type","correct":"import type { PluginOptions } from 'tangl-i18next-vite'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport tanglI18nextVite from 'tangl-i18next-vite';\n\nexport default defineConfig({\n  plugins: [\n    tanglI18nextVite({\n      locales: ['en', 'es'],\n      defaultLocale: 'en',\n      sourceDir: 'src/locales',\n      outDir: 'dist/locales',\n    }),\n  ],\n});","lang":"typescript","description":"Basic Vite configuration integrating the tangl-i18next-vite plugin with two locales."},"warnings":[{"fix":"Update your Vite config to pass locales as an array e.g., locales: ['en', 'es'].","message":"Plugin options structure changed in v1.2.0: 'locales' is now an array, not comma-separated string.","severity":"breaking","affected_versions":"<1.2.0"},{"fix":"Remove 'namespaces' and reorganize locale files into subdirectories per namespace.","message":"The 'namespaces' option is deprecated in v1.1.0. Use 'locales' with nested folder structure instead.","severity":"deprecated","affected_versions":">=1.1.0 <1.2.4"},{"fix":"Ensure all locale files are .json and located under sourceDir.","message":"Source locale files must have a .json extension; otherwise, the plugin ignores them silently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set 'moduleResolution' to 'bundler' or 'node16' in tsconfig.json.","message":"When using TypeScript, the plugin type definitions are only bundled for ESM; CJS projects may need @ts-ignore or explicit type declarations.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install the package: npm install tangl-i18next-vite --save-dev; for type resolution issues, set 'moduleResolution': 'bundler' in tsconfig.","cause":"The package is not installed or TypeScript cannot resolve types for CJS.","error":"Cannot find module 'tangl-i18next-vite' or its corresponding type declarations."},{"fix":"Use dynamic import() or convert your project to ESM (set 'type': 'module' in package.json).","cause":"tangl-i18next-vite is ESM-only and cannot be require'd directly.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use import { tanglI18nextVite } from 'tangl-i18next-vite' instead of default import.","cause":"Incorrect import syntax; the plugin expects a named import.","error":"The requested module 'tangl-i18next-vite' does not provide an export named 'default'"},{"fix":"Change to locales: ['en', 'es'] per v1.2.0+ breaking change.","cause":"Passing locales as a comma-separated string (old API) instead of array.","error":"Plugin 'vite-plugin-i18n' (tangl-i18next-vite) threw an error: locales option must be an array"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}