{"id":25349,"library":"esbuild-plugin-i18next-loader","title":"esbuild-plugin-i18next-loader","description":"esbuild plugin to bundle i18next translation files (JSON/YAML) into a virtual module for client-side use. Current stable version is 1.1.5, released under the i18next-utilities monorepo with regular patch updates. It rewrites alienfast/vite-plugin-i18next-loader for esbuild, supporting namespace resolution via basename or relative path, and multiple locale paths. Differentiators: ESM-only builds, TypeScript types included, virtual module generation for tree-shaking.","status":"active","version":"1.1.5","language":"javascript","source_language":"en","source_url":"https://github.com/rowellx68/i18next-utilities","tags":["javascript","esbuild","i18next","loader","plugin","typescript"],"install":[{"cmd":"npm install esbuild-plugin-i18next-loader","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-i18next-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-i18next-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function","package":"esbuild","optional":false},{"reason":"peer dependency for runtime locale usage","package":"i18next","optional":false}],"imports":[{"note":"ESM-only, no CommonJS support. Use dynamic import if needed.","wrong":"const i18nextPlugin = require('esbuild-plugin-i18next-loader').i18nextPlugin","symbol":"i18nextPlugin","correct":"import { i18nextPlugin } from 'esbuild-plugin-i18next-loader'"},{"note":"Default export is the plugin function, but named export is preferred.","wrong":"import { default as i18nextPlugin } from 'esbuild-plugin-i18next-loader'","symbol":"default","correct":"import i18nextPlugin from 'esbuild-plugin-i18next-loader'"},{"note":"Options type is not a runtime value; use type import for TypeScript.","wrong":"import { Options } from 'esbuild-plugin-i18next-loader'","symbol":"type Options","correct":"import type { Options } from 'esbuild-plugin-i18next-loader'"}],"quickstart":{"code":"import { i18nextPlugin } from 'esbuild-plugin-i18next-loader';\nimport esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['./src/index.ts'],\n  write: true,\n  bundle: true,\n  plugins: [\n    i18nextPlugin({\n      namespaceResolution: 'basename',\n      paths: ['./src/locales'],\n    }),\n  ],\n});","lang":"typescript","description":"Shows how to use the plugin with esbuild to bundle i18next locale files from ./src/locales."},"warnings":[{"fix":"Use import syntax instead of require(). If using CommonJS, consider dynamic import.","message":"ESM-only since v1.1.3","severity":"breaking","affected_versions":">=1.1.3"},{"fix":"Set namespaceResolution to 'basename' or 'relativePath' as needed.","message":"namespaceResolution strategy must be set explicitly; if omitted, namespace defaults to basename but may cause collisions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use named import { i18nextPlugin } instead of default import.","message":"Plugin name changed from default export to named export in v1.1.0","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev esbuild-plugin-i18next-loader and ensure import path is correct.","cause":"Package not installed or incorrect import path.","error":"Cannot find module 'esbuild-plugin-i18next-loader'"},{"fix":"Use dynamic import: const { i18nextPlugin } = await import('esbuild-plugin-i18next-loader');","cause":"Package is ESM-only, require() not allowed.","error":"require() of ES Module esbuild-plugin-i18next-loader not supported"},{"fix":"Use import { i18nextPlugin } from 'esbuild-plugin-i18next-loader';","cause":"Using default import after v1.1.0 when named export is required.","error":"TypeError: i18nextPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}