npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

unplugin-lingui-macro

v0.2.1

Published

Bundler plugin for compiling Lingui macros in plain JavaScript and TypeScript modules.

Readme

unplugin-lingui-macro

npm Documentation

Bundler plugin for compiling Lingui macros in plain JavaScript and TypeScript modules.

Requirements: @lingui/core ^5.0.0, Node.js 22+

This package is useful when your app uses Lingui macros outside framework-owned files such as .svelte or .astro.

It provides:

  • Lingui macro compilation through unplugin
  • Vite, Rollup, Webpack, esbuild, Rolldown, Rspack, and Bun entrypoints
  • optional linguiConfig overrides for macro and runtime bindings

Install

vp add -D unplugin-lingui-macro

# or run one of:
npm install -D unplugin-lingui-macro
pnpm add -D unplugin-lingui-macro
yarn add -D unplugin-lingui-macro

You will usually also want Lingui itself:

vp add @lingui/core
vp add -D @lingui/cli @lingui/conf

# or
npm install @lingui/core
npm install -D @lingui/cli @lingui/conf

# or
pnpm add @lingui/core
pnpm add -D @lingui/cli @lingui/conf

# or
yarn add @lingui/core
yarn add -D @lingui/cli @lingui/conf

Quick Start

Vite:

import { defineConfig } from "vite";
import linguiMacro from "unplugin-lingui-macro/vite";

export default defineConfig({
  plugins: [linguiMacro()],
});

Then use Lingui macros in plain modules:

import { t } from "@lingui/core/macro";

export const pageTitle = t`Settings`;

What It Transforms

The plugin scans script-like files and only runs when it finds Lingui macro imports.

By default it supports Lingui macro imports from:

  • @lingui/core/macro
  • @lingui/macro
  • @lingui/react/macro

These are used only to detect whether a file needs transformation. @lingui/react/macro is included so that React projects importing from that path are handled correctly in plain .js and .ts files alongside React islands.

Framework packages such as lingui-for-svelte and lingui-for-astro can also pass their own macro package names through linguiConfig.

Options

import linguiMacro from "unplugin-lingui-macro/vite";

export default {
  plugins: [
    linguiMacro({
      linguiConfig: {
        runtimeConfigModule: {
          i18n: ["@lingui/core", "i18n"],
        },
      },
    }),
  ],
};

Supported option shape:

Entrypoints

  • unplugin-lingui-macro: base unplugin instance
  • unplugin-lingui-macro/vite
  • unplugin-lingui-macro/rollup
  • unplugin-lingui-macro/webpack
  • unplugin-lingui-macro/esbuild
  • unplugin-lingui-macro/rolldown
  • unplugin-lingui-macro/rspack
  • unplugin-lingui-macro/bun
  • unplugin-lingui-macro/types

Notes

  • This package is for plain script modules. Use framework-specific packages for framework-owned files such as .svelte and .astro.
  • The transform runs only for files that actually import Lingui macros.
  • It does not perform Lingui extraction by itself. Extraction still comes from Lingui CLI and the relevant extractor setup.