Registry / devops / esbuild-plugin-lingui-po-loader

esbuild-plugin-lingui-po-loader

JSON →
library1.0.1jsnpmunverified

An esbuild plugin that loads Lingui message catalogs from .po files, enabling seamless integration with Lingui internationalization. Current version 1.0.1, stable. Converts .po files to JavaScript modules at build time, reducing runtime overhead. Supports TypeScript types. There are few alternatives; this fills a specific niche for Lingui users on esbuild.

npm install esbuild-plugin-lingui-po-loader
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-LIN
E
esbuild-plugin-lingui-po-loader
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

linguiPoLoader
import { linguiPoLoader } from 'esbuild-plugin-lingui-po-loader'
import linguiPoLoader from 'esbuild-plugin-lingui-po-loader'
Named export only; default import will result in undefined.
linguiPoLoader (require)
const { linguiPoLoader } = require('esbuild-plugin-lingui-po-loader')
const linguiPoLoader = require('esbuild-plugin-lingui-po-loader')
CommonJS require must destructure the named export.
type definitions
import { linguiPoLoader } from 'esbuild-plugin-lingui-po-loader'
import { linguiPoLoader } from '@types/esbuild-plugin-lingui-po-loader'
TypeScript types are bundled; no separate @types package needed.

Shows how to use the plugin with esbuild to automatically load .po files during the build.

import { build } from 'esbuild'; import { linguiPoLoader } from 'esbuild-plugin-lingui-po-loader'; await build({ entryPoints: ['src/index.ts'], outfile: 'dist/bundle.js', plugins: [linguiPoLoader()], });
Debug
Known issues
gotchaThe plugin only processes .po files; any other file types (e.g., .mo) are ignored. Ensure your catalogs are in .po format.
fix
Convert .mo files to .po using tools like msgfmt --text --output-file messages.po messages.mo.
affects: >=1.0.0
gotchaThe plugin does not handle hot reload or watch mode natively; esbuild's watch mode may not trigger recompilation on .po changes if not configured correctly.
fix
Use the 'onRebuild' option in esbuild's watch mode to clear cache or re-run the plugin.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not resolve './messages.po'
The plugin is not registered in the esbuild plugins array, or esbuild cannot locate the .po file.
fix
Ensure the plugin is added to the plugins array: build({ plugins: [linguiPoLoader()] }).
Cannot find module 'esbuild-plugin-lingui-po-loader'
Missing installation or incorrect import path.
fix
Install the package: npm install esbuild-plugin-lingui-po-loader (or bun add, yarn add, etc.).
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency required as the plugin runs as an esbuild plugin.
Agent activity
6 hits · last 30 days
node
6
Resources
esbuild-plugin-lingui-po-loader — npm install esbuild-plugin-lingui-po-loader · libregistry