{"id":26327,"library":"rollup-plugin-i18never","title":"rollup-plugin-i18never","description":"A Rollup plugin for automatic internationalization (i18n) using i18never. Version 1.1.16 ships TypeScript types and requires Rollup ^3.26.3 as a peer dependency. It provides zero-config extraction of translatable strings from source code, enabling build-time injection of locale dictionaries. Unlike runtime i18n libraries, this plugin statically replaces i18n function calls with translated strings at build time, eliminating runtime overhead. Designed for small to medium projects that want simple i18n without heavy frameworks. Released in 2023 with occasional maintenance updates.","status":"active","version":"1.1.16","language":"javascript","source_language":"en","source_url":"https://github.com/ksc-fe/i18never","tags":["javascript","i18never","i18n","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-i18never","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-i18never","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-i18never","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: works as a Rollup plugin, must be installed alongside","package":"rollup","optional":false}],"imports":[{"note":"The package outputs an ESM default export; CJS require works in Rollup config due to Rollup's handling, but for consistency use ESM import.","wrong":"const i18never = require('rollup-plugin-i18never')","symbol":"default (i18never)","correct":"import i18never from 'rollup-plugin-i18never'"},{"note":"The plugin must be called as a function (i18never()) to return a plugin object.","wrong":"plugins: [i18never] // forgot parentheses to call the function","symbol":"default (in Vite config)","correct":"import i18never from 'rollup-plugin-i18never'\n// vite.config.js\nexport default defineConfig({ plugins: [i18never()] })"},{"note":"The package has only a default export; destructuring will result in undefined.","wrong":"const { i18never } = require('rollup-plugin-i18never')","symbol":"default (in CommonJS)","correct":"const i18never = require('rollup-plugin-i18never');"}],"quickstart":{"code":"// Install: npm install rollup rollup-plugin-i18never\n// rollup.config.js\nimport i18never from 'rollup-plugin-i18never';\n\nexport default {\n  input: 'src/index.js',\n  output: { dir: 'dist', format: 'es' },\n  plugins: [\n    i18never({\n      // options (optional): translations, functions, locales, etc.\n    })\n  ]\n};\n\n// src/index.js\n// Requires i18never runtime to be set up separately\nimport { t } from 'i18never';\nconsole.log(t('hello'));\n\n// Build command: npx rollup --config rollup.config.js","lang":"typescript","description":"Minimal Rollup configuration using the i18never plugin to statically replace i18n function calls with translations at build time."},"warnings":[{"fix":"Use plugins: [i18never()] instead of plugins: [i18never]","message":"Plugin must be called as a function: i18never() not i18never","severity":"gotcha","affected_versions":"all"},{"fix":"Install i18never package: npm install i18never, and initialize it before using t() calls.","message":"The plugin only works with i18never runtime installed and configured separately; it does not provide i18n runtime. Missing i18never will cause runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure all translatable strings are literal strings passed to t() or other configured translation functions.","message":"The plugin statically replaces strings at build time; dynamic keys (e.g., t(variable)) will not be translated and may cause unexpected behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider pinning Rollup to version 3.x, or check plugin compatibility with Rollup 4.","message":"Requires Rollup ^3.26.3; not officially tested with Rollup 4.x. May work but no guarantees.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use plugins: [i18never({})] instead of plugins: [i18never]","cause":"Importing the default export but treating it as a plugin object, not calling it as a function.","error":"Error: Plugin 'i18never' does not exist? (no error string provided in docs, but common missing call issue) Actually, typical error: 'TypeError: i18never is not a function'"},{"fix":"Install i18never: npm install i18never, and ensure it is imported in your source files.","cause":"The i18never runtime package is required in the bundled output; the plugin does not bundle it.","error":"Error: Cannot find module 'i18never' (or equivalent when runtime not installed)."},{"fix":"Import and initialize i18never before using t(): import i18never from 'i18never'; i18never.init({locale: 'en', translations: ...});","cause":"Missing i18never runtime initialization.","error":"ReferenceError: t is not defined (at runtime)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}