Rust tooling for Lingui i18n - an SWC plugin for the macro transform and a native Node.js addon for message extraction.
This monorepo hosts the Rust-based tooling for Lingui. It ships two npm packages built from the same Rust crates:
@lingui/swc-plugin- an SWC plugin (WebAssembly) that transforms@lingui/core/macroand@lingui/react/macrocalls into optimized i18n runtime code at build time. A faster, Rust-powered alternative to the Babel macro that runs inside SWC, Next.js, and Vite build pipelines.@lingui/native-tools- a native Node.js addon (NAPI-RS) with a Rust message extractor forlingui extractand a standalone macro transformer for custom build pipelines.
SWC macro transform plugin for Lingui. Transforms @lingui/macro and @lingui/react/macro calls into optimized i18n runtime code. Compiles to WebAssembly (wasm32-wasip1).
- Installation, usage & options -
@lingui/swc-pluginREADME swc_corecompatibility table - Compatibility- Lingui macro reference
Native Node.js addon (NAPI-RS) with a Rust message extractor and a standalone macro transformer. Provides createSwcExtractor() for lingui extract and transform() for custom build pipelines that only need the Lingui macro step. Prebuilt binaries are published for macOS, Linux (glibc and musl), Windows, and Android.
Note
@lingui/native-toolsis pre-1.0. The API may change between minor versions until the 1.0 release.
- Installation, usage & options -
@lingui/native-toolsREADME
Contributions are welcome! See CONTRIBUTING.md for instructions on setting up Rust, building the WASM plugin, running tests, and submitting pull requests.
The project is licensed under the MIT license.