Registry / serialization / rollup-plugin-i18next-conv

rollup-plugin-i18next-conv

JSON →
library10.0.0jsnpmunverified

A Rollup plugin that imports PO (gettext) files as i18next-compatible JSON objects, enabling seamless integration of i18next translation workflows into your build. Version 10.0.0 requires Node >=20 and supports Rollup 2/3/4 and i18next-conv >=14. Released about every 6 months with breaking changes tied to Node EOL. Differentiators: deterministic locale extraction from file paths, customizable include/exclude patterns, and passthrough of all i18next-conv options. Unlike alternatives, it focuses exclusively on PO file conversion with zero runtime overhead.

npm install rollup-plugin-i18next-conv
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-I18N
R
rollup-plugin-i18next-conv
serializationjavascriptv10.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import i18next from 'rollup-plugin-i18next-conv'
✗ const i18next = require('rollup-plugin-i18next-conv').default
Module is ESM-only since v7.0.0. Use default import.
i18next
✓ import i18next from 'rollup-plugin-i18next-conv'
✗ import { i18next } from 'rollup-plugin-i18next-conv'
The module exports a default function, not a named export. Named import will yield undefined.
require (CJS)
✓ const i18next = await import('rollup-plugin-i18next-conv')
✗ const i18next = require('rollup-plugin-i18next-conv')
Since v7, the package is ESM-only. Use dynamic import inside an async context or switch to ESM.

Configures i18next-conv Rollup plugin to import PO files from locale directories, with custom locale detection and key separator.

// rollup.config.js import i18next from 'rollup-plugin-i18next-conv'; import path from 'path'; export default { input: 'src/main.js', output: { file: 'dist/bundle.js', format: 'iife' }, plugins: [ i18next({ include: ['**/locale/**/*.po'], exclude: ['node_modules/**'], determineLocale: (filename) => filename.split(path.sep).slice(-3)[0], keyseparator: '$$' }) ] };
Debug
Known issues
breakingNode.js >=20 required since v10.0.0
fix
Upgrade Node.js to version 20 or later.
affects: >=10.0.0
breakingESM-only module; CommonJS require() no longer works
fix
Use import statements or dynamic import() instead of require().
affects: >=7.0.0
breakingMinimum peer dependency i18next-conv >=14 required since v8.0.0
fix
Update i18next-conv to version 14 or higher.
affects: >=8.0.0
breakingRollup 3 support dropped; v8.1.0 added Rollup 4 support
fix
Check that your Rollup version is ^2.0.0, ^3.0.0, or ^4.0.0.
affects: >=8.1.0
deprecatedRollup 2 support deprecated; future versions may require Rollup >=3
fix
Migrate to Rollup 3 or 4.
affects: >=10.0.0
gotchaDefault locale extraction assumes locale folder is third segment from end of path
fix
Override determineLocale function if your folder structure differs.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-i18next-conv'
Missing npm install or incorrect import path.
fix
Run `npm install --save-dev rollup-plugin-i18next-conv` and ensure package.json includes it.
TypeError: i18next is not a function
Using named import `{ i18next }` instead of default import.
fix
Change to `import i18next from 'rollup-plugin-i18next-conv'`.
Error: The 'i18next-conv' package is required. Please install it.
Missing peer dependency i18next-conv.
fix
Run `npm install --save-dev i18next-conv`.
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using require() on an ESM-only package (>= v7).
fix
Switch to import syntax or use dynamic import().
Upgrade
Version history
10.0.0latest on npm
Audit
Dependencies
i18next-convrequiredPeer dependency – required at runtime for converting PO files to i18next JSON format.
rolluprequiredPeer dependency – required as the build system; versions 2, 3, or 4 supported.
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-i18next-conv — npm install rollup-plugin-i18next-conv · libregistry