Socket
Socket
Sign inDemoInstall

@lingui/vite-plugin

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lingui/vite-plugin

Vite plugin for Lingui message catalogs


Version published
Weekly downloads
31K
increased by2.07%
Maintainers
2
Weekly downloads
 
Created
Source

License Version Downloads

@lingui/vite-plugin

Vite plugin that compiles Lingui catalogs on the fly. In summary, the lingui compile command isn't needed when using this plugin.

@lingui/vite-plugin is part of LinguiJS. See the documentation for all information, tutorials and examples.

Installation

npm install --save-dev @lingui/vite-plugin
# yarn add --dev @lingui/vite-plugin

Usage

Via vite.config.ts

import { UserConfig } from 'vite';
import { lingui } from '@lingui/vite-plugin'

const config: UserConfig = {
  plugins: [lingui()]
}

Then in Vite-processed code:

// *.po files assigned to this loader by default
const { messages } = await import(`./locales/${language}.po`);

// for other extension you have to use `?lingui` suffix
const { messages } = await import(`./locales/${language}.json?lingui`);

See Vite's official documentation for more info about Vite dynamic imports https://vitejs.dev/guide/features.html#dynamic-import

License

MIT

Keywords

FAQs

Package last updated on 31 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc